:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5d6370;
  --line: #dfe2e8;
  --accent: #3a5bd9;
  --accent-text: #ffffff;
  --code-bg: #eef0f4;
  --ok: #176b2c;
  --bad: #a11d1d;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115;
    --surface: #181b21;
    --text: #e8eaef;
    --muted: #9aa1ad;
    --line: #2a2f38;
    --accent: #7b96ff;
    --accent-text: #0f1115;
    --code-bg: #1f232b;
    --ok: #5fcf7c;
    --bad: #ff7b7b;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1115; --surface: #181b21; --text: #e8eaef; --muted: #9aa1ad; --line: #2a2f38;
  --accent: #7b96ff; --accent-text: #0f1115; --code-bg: #1f232b; --ok: #5fcf7c; --bad: #ff7b7b;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
button, select {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
}
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
code, pre { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }
pre { background: var(--code-bg); padding: 14px 16px; border-radius: var(--radius); overflow-x: auto; line-height: 1.45; }
pre code { background: none; padding: 0; }
.error { color: var(--bad); }

/* ---------- site chrome (catalog, creator, developer, docs) ---------- */
.site-header {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px max(16px, calc((100vw - 1100px) / 2));
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.site-header .brand { font-weight: 700; text-decoration: none; color: var(--text); margin-right: auto; }
.site-header nav a { margin-left: 16px; text-decoration: none; }
.page { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
.page h1 { font-size: 1.8rem; margin: 0 0 8px; }
.lede { color: var(--muted); margin-top: 0; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: var(--text); display: flex; flex-direction: column;
}
.card:hover { border-color: var(--accent); }
.card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--code-bg); display: block; }
.card .body { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.card .name { font-weight: 650; }
.card .meta { color: var(--muted); font-size: 0.85rem; }

.panel-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 18px 0; }
.panel-box h2 { margin-top: 0; font-size: 1.15rem; }
.form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.form-row input { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.data th, table.data td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { color: var(--muted); font-weight: 600; }
.secret { font-family: var(--mono); word-break: break-all; background: var(--code-bg); padding: 10px; border-radius: 8px; }

/* ---------- docs ---------- */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; }
.docs nav.toc { position: sticky; top: 16px; align-self: start; font-size: 0.9rem; }
.docs nav.toc a { display: block; padding: 3px 0; text-decoration: none; color: var(--muted); }
.docs nav.toc a:hover { color: var(--accent); }
.docs article h2 { margin-top: 2.2em; padding-top: 0.4em; border-top: 1px solid var(--line); }
.docs article h3 { margin-top: 1.6em; }
.docs article table { border-collapse: collapse; width: 100%; font-size: 0.92rem; margin: 12px 0; display: block; overflow-x: auto; }
.docs article p code, .docs article li code, .docs article td code { overflow-wrap: anywhere; } /* long addresses wrap on a phone */
.docs article th, .docs article td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; vertical-align: top; }
.callout { border-left: 4px solid var(--accent); background: var(--surface); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 16px 0; }
.callout.warn { border-left-color: var(--bad); }
@media (max-width: 820px) {
  .docs { grid-template-columns: minmax(0, 1fr); } /* 1fr would grow to the widest code line, wider than a phone */
  .docs nav.toc { position: static; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
}

/* ---------- play shell ---------- */
body.play { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: #000; color: #e8eaef; color-scheme: dark;
  /* the play page is always dark, so are its dialogs (the profile, purchases) whatever the system's theme */
  --bg: #0f1115; --surface: #181b21; --text: #e8eaef; --muted: #9aa1ad; --line: #2a2f38;
  --accent: #7b96ff; --accent-text: #0f1115; --code-bg: #1f232b; --ok: #5fcf7c; --bad: #ff7b7b; }
/* players' avatars (GP.playerAvatar, player_avatars.py): a stock picture, or the username's first letter on a pink
   disc (a new player-1234 shows "P"), or a guest's silhouette. Each use below sets the size (so these come first); the
   letter scales with font-size */
.avatar { display: inline-block; flex: none; width: 28px; height: 28px; border-radius: 50%; object-fit: cover; box-sizing: border-box; vertical-align: middle; }
.avatar-letter { display: inline-grid; place-items: center; background: #ff2d9e; color: #15171c; font-weight: 800; line-height: 1; font-size: 14px; }
.avatar-guest { background: #3a3f4a no-repeat center / 62% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4.2' fill='%23c7ccd6'/%3E%3Cpath d='M3.5 21a8.5 8.5 0 0 1 17 0z' fill='%23c7ccd6'/%3E%3C/svg%3E"); }
/* the Sweet menu (js/shell.js): a small pill floating over the game with the player's avatar, username and (on a
   computer) credits, in the corner its manifest picks, and the panel it opens. The game gets the whole screen; gp.menu tells it which corner
   (about 300 x 60 px) to keep clear. Glass on the play page's own dark greys, with a soft light edge */
.menu { position: fixed; z-index: 20; --menu-gap: 10px; --menu-gap-right: var(--menu-gap); --menu-glass: rgba(20, 22, 28, 0.86); --menu-edge: rgba(255, 255, 255, 0.16);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
/* with a mouse, a game that scrolls has a scrollbar down its right edge: the right corners stay clear of it */
@media (pointer: fine) { .menu { --menu-gap-right: 28px; } }
.menu[data-corner="top-right"] { top: calc(env(safe-area-inset-top) + var(--menu-gap)); right: calc(env(safe-area-inset-right) + var(--menu-gap-right)); }
.menu[data-corner="top-left"] { top: calc(env(safe-area-inset-top) + var(--menu-gap)); left: calc(env(safe-area-inset-left) + var(--menu-gap)); }
.menu[data-corner="bottom-right"] { bottom: calc(env(safe-area-inset-bottom) + var(--menu-gap)); right: calc(env(safe-area-inset-right) + var(--menu-gap-right)); }
.menu[data-corner="bottom-left"] { bottom: calc(env(safe-area-inset-bottom) + var(--menu-gap)); left: calc(env(safe-area-inset-left) + var(--menu-gap)); }
/* moved by the player (js/shell.js menuMoveTo): exactly where it was dropped, measured from the nearest corner */
.menu.placed[data-corner="top-right"] { top: var(--menu-y); right: var(--menu-x); }
.menu.placed[data-corner="top-left"] { top: var(--menu-y); left: var(--menu-x); }
.menu.placed[data-corner="bottom-right"] { bottom: var(--menu-y); right: var(--menu-x); }
.menu.placed[data-corner="bottom-left"] { bottom: var(--menu-y); left: var(--menu-x); }
.menu-pill {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 6px; border-radius: 999px;
  border: 1px solid var(--menu-edge); background: var(--menu-glass); color: #e8eaef; cursor: pointer;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 18px rgba(255, 255, 255, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-weight: 650; font-size: 0.9rem; line-height: 1; transition: opacity 0.35s ease, background 0.2s ease;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; /* a drag moves it */
}
.menu-shield { position: fixed; inset: 0; z-index: 19; } /* over the game while the pill is pressed (js/shell.js wireMenuDrag) */
.menu-shield[hidden] { display: none; }
.menu.dragging + .menu-shield, body:has(.menu.dragging) .menu-shield { cursor: grabbing; }
.menu.dragging .menu-pill { cursor: grabbing; opacity: 1; background: rgba(30, 33, 41, 0.96); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), 0 0 0 2px rgba(255, 255, 255, 0.18); }
.menu-pill:hover, .menu-pill:focus-visible, .menu-pill[aria-expanded="true"] { background: rgba(30, 33, 41, 0.96); opacity: 1; }
.menu-pill.idle:not(:hover):not(:focus-visible):not([aria-expanded="true"]) { opacity: 0.55; }
.menu-avatar-box { display: flex; flex: none; }
.menu-avatar { width: 28px; height: 28px; font-size: 14px; }
.menu-name { max-width: 8em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #f2f3f6; } /* with the balance, the pill stays inside gp.menu's 300px */
.menu-balance { display: inline-flex; align-items: center; gap: 5px; color: #ffd166; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.menu-balance .credit-icon { width: 1.1em; height: 1.1em; }
.menu-balance:empty { display: none; }
/* phones (upright, or a short touch screen on its side) show the avatar and name only: the credits are in the menu */
@media (max-width: 720px), (pointer: coarse) and (max-height: 520px) { .menu-balance { display: none; } }
.menu-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff5c7a; box-shadow: 0 0 0 2px rgba(17, 19, 23, 0.9); }
.menu-dot[hidden] { display: none; }
.menu-chevron { width: 7px; height: 7px; margin: 0 1px 3px 2px; border-right: 2px solid #c7ccd6; border-bottom: 2px solid #c7ccd6; transform: rotate(45deg); }
.menu-pill[aria-expanded="true"] .menu-chevron { margin-bottom: -3px; transform: rotate(-135deg); }
@media (max-width: 420px) { .menu-name { max-width: 6.5em; } }
/* until the game and the player are known (js/shell.js fills them): placeholders shaped like what comes, never text */
.menu-avatar-box:empty::before, .menu-name:empty::before, .menu-title-block h1:empty::before, .menu-title-block .creator:empty::before,
.menu-me-avatar-box:empty::before, .menu-me-text b:empty::before {
  content: ""; display: block; border-radius: 999px; background: rgba(255, 255, 255, 0.13); animation: menu-bone 1.6s ease-in-out infinite; }
.menu-avatar-box:empty::before { width: 28px; height: 28px; }
.menu-name:empty::before { width: 4.6em; height: 0.8em; }
.menu-title-block h1:empty::before { width: 9em; height: 0.85em; margin: 0.15em 0; }
.menu-title-block .creator:empty::before { width: 6em; height: 0.75em; }
.menu-me-avatar-box:empty::before { width: 44px; height: 44px; }
.menu-me-text b:empty::before { width: 7em; height: 0.8em; }
@keyframes menu-bone { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .menu *:empty::before { animation: none; } }
.menu-panel {
  position: absolute; width: min(340px, calc(100vw - 20px)); max-height: calc(100dvh - var(--menu-y, var(--menu-gap)) - 66px); overflow-y: auto; padding: 18px;
  border: 1px solid var(--menu-edge); border-radius: 22px; background: rgba(20, 22, 28, 0.94); color: #e8eaef;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.55), 0 0 28px rgba(255, 255, 255, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
}
.menu-panel[hidden] { display: none; }
.menu[data-corner^="top"] .menu-panel { top: calc(100% + 10px); }
.menu[data-corner^="bottom"] .menu-panel { bottom: calc(100% + 10px); }
.menu[data-corner$="right"] .menu-panel { right: 0; }
.menu[data-corner$="left"] .menu-panel { left: 0; }
.menu-game { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 2px 2px 0; }
.menu-title-block { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.menu-title-block h1 { font-size: 1.2rem; font-weight: 750; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-title-block .creator { font-size: 0.85rem; color: #9aa1ad; text-decoration: none; }
.menu-title-block .creator:hover { text-decoration: underline; }
/* Sweet's logo: back to every game */
.menu-home { flex: none; display: flex; align-items: center; padding: 6px 8px; margin: -4px -6px 0 0; border-radius: 10px; opacity: 0.75; }
.menu-home img { display: block; height: 18px; width: auto; }
.menu-home:hover, .menu-home:focus-visible { opacity: 1; background: rgba(255, 255, 255, 0.06); }
.menu-account {
  margin-top: 14px; padding: 14px 16px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.045); display: flex; flex-direction: column; gap: 12px;
}
/* who's playing: their avatar, username and credits, then Add (the wallet); a guest gets Sign in */
.menu-me { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.menu-me-avatar-box { display: flex; flex: none; }
.menu-me-avatar { width: 44px; height: 44px; font-size: 20px; }
.menu-me-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.menu-me-text b { font-size: 1.02rem; color: #f2f3f6; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.menu-me .credits { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; color: #ffd166; font-size: 0.98rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.menu-me .credits:empty { display: none; }
.menu-me .credits .credit-icon { width: 1.05em; height: 1.05em; }
.menu-me .credits small { color: #c7ccd6; font-size: 0.85rem; font-weight: 500; overflow-wrap: anywhere; }
.menu-signin { flex: none; padding: 9px 18px; border-radius: 11px; border: 0; background: #ff2d9e; color: #15171c; font-weight: 800; font-size: 0.92rem; cursor: pointer; }
.menu-signin:hover, .menu-signin:focus-visible { filter: brightness(1.08); }
.menu-signin[hidden], .menu-add[hidden] { display: none; }
/* "Make it yours": a default player-1a2b3c4d name, or no avatar yet */
.menu-make {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 12px; text-align: left; cursor: pointer;
  border: 1px solid rgba(255, 45, 158, 0.45); background: rgba(255, 45, 158, 0.1); color: #f2f3f6; font: inherit;
}
.menu-make[hidden] { display: none; }
.menu-make:hover, .menu-make:focus-visible { background: rgba(255, 45, 158, 0.16); }
.menu-make-icon { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #ff2d9e; color: #15171c; font-size: 0.95rem; }
.menu-make b { display: block; font-size: 0.95rem; }
.menu-make small { display: block; margin-top: 2px; color: #c7ccd6; font-size: 0.8rem; }
/* a guest whose progress only this device keeps (gp.progress): an account keeps it anywhere */
.menu-keep { margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 209, 102, 0.08); border: 1px solid rgba(255, 209, 102, 0.28);
  color: #e8e2cf; font-size: 0.84rem; line-height: 1.45; }
.menu-keep[hidden] { display: none; }
.menu-keep button { padding: 0; border: 0; background: none; color: #ff5cb0; font: inherit; font-weight: 700; text-decoration: underline;
  text-underline-offset: 2px; cursor: pointer; }
.menu-keep button:hover, .menu-keep button:focus-visible { color: #ff7cc0; }
.menu-add {
  flex: none; padding: 9px 18px; border-radius: 11px; background: linear-gradient(180deg, #ffe08a, #ffc43d); color: #15171c;
  font-weight: 800; font-size: 0.95rem; text-decoration: none; box-shadow: 0 4px 14px rgba(255, 196, 61, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.menu-add:hover { filter: brightness(1.05); }
.menu-actions { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.menu-action {
  display: flex; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 16px;
  background: rgba(255, 255, 255, 0.045); color: #e8eaef; text-align: left; font: inherit; cursor: pointer; min-width: 0;
}
.menu-action[hidden], .menu-actions[hidden] { display: none; }
.menu-action:hover, .menu-action:focus-visible { background: rgba(255, 255, 255, 0.08); }
.menu-action-text { flex: 1; min-width: 0; }
.menu-action b { display: block; font-size: 1rem; }
.menu-action small { display: block; margin-top: 3px; color: #9aa1ad; font-size: 0.82rem; }
.menu-action.club-button b { color: #ffd166; }
.menu-icon { font-size: 1.45rem; line-height: 1; width: 1.6rem; text-align: center; }
/* Exit to all games: back to the play hub's search (index.html #browse), Sweet's pink on the menu's glass */
.menu-exit {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; min-height: 48px; padding: 0 16px;
  border: 1px solid rgba(255, 45, 158, 0.5); border-radius: 16px; background: rgba(255, 45, 158, 0.08); color: #ff5cb0;
  font-weight: 700; font-size: 1rem; text-decoration: none; transition: background 0.15s ease, border-color 0.15s ease;
}
.menu-exit svg { flex: none; width: 13px; height: 13px; fill: currentColor; transition: transform 0.15s ease; }
.menu-exit:hover, .menu-exit:focus-visible { background: rgba(255, 45, 158, 0.16); border-color: rgba(255, 45, 158, 0.75); color: #ff7cc0; }
.menu-exit:hover svg { transform: translateX(-3px); }
@media (prefers-reduced-motion: reduce) { .menu-exit, .menu-exit svg { transition: none; } .menu-exit:hover svg { transform: none; } }
.menu-reset { display: block; margin: 12px auto 0; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: #9aa1ad; font-size: 0.82rem; text-decoration: underline; cursor: pointer; }
.menu-reset[hidden] { display: none; }
.menu-reset:hover { color: #e8eaef; }
.menu-go { flex: none; width: 8px; height: 8px; margin-right: 4px; border-right: 2px solid #c7ccd6; border-top: 2px solid #c7ccd6; transform: rotate(45deg); }
/* the verified creator badge (GP.verifiedBadge): a check in a sky-blue seal, as on the site (components/site/Verified.tsx) */
.verified { display: inline-block; width: 0.95em; height: 0.95em; margin-left: 0.3em; vertical-align: -0.12em; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%235ec8ff' d='M11.2 1.5Q12 0.8 12.8 1.5L13.7 2.2Q14.4 2.9 15.4 2.7L16.6 2.5Q17.6 2.3 17.9 3.3L18.3 4.4Q18.6 5.4 19.6 5.7L20.7 6.1Q21.7 6.4 21.5 7.4L21.3 8.6Q21.1 9.6 21.8 10.3L22.5 11.2Q23.2 12 22.5 12.8L21.8 13.7Q21.1 14.4 21.3 15.4L21.5 16.6Q21.7 17.6 20.7 17.9L19.6 18.3Q18.6 18.6 18.3 19.6L17.9 20.7Q17.6 21.7 16.6 21.5L15.4 21.3Q14.4 21.1 13.7 21.8L12.8 22.5Q12 23.2 11.2 22.5L10.3 21.8Q9.6 21.1 8.6 21.3L7.4 21.5Q6.4 21.7 6.1 20.7L5.7 19.6Q5.4 18.6 4.4 18.3L3.3 17.9Q2.3 17.6 2.5 16.6L2.7 15.4Q2.9 14.4 2.2 13.7L1.5 12.8Q0.8 12 1.5 11.2L2.2 10.3Q2.9 9.6 2.7 8.6L2.5 7.4Q2.3 6.4 3.3 6.1L4.4 5.7Q5.4 5.4 5.7 4.4L6.1 3.3Q6.4 2.3 7.4 2.5L8.6 2.7Q9.6 2.9 10.3 2.2Z'/%3E%3Cpath fill='none' stroke='%230f0c1a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M7.8 12.3l2.8 2.8 5.6-5.8'/%3E%3C/svg%3E"); }
/* Titan's gold verified badge (tiers.py verified_badge "gold": GP.verifiedBadge('gold')), the plan card's gold seal */
.verified.gold { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23f3d68f'/%3E%3Cstop offset='.55' stop-color='%23d4a23f'/%3E%3Cstop offset='1' stop-color='%23a8761f'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M11.2 1.5Q12 0.8 12.8 1.5L13.7 2.2Q14.4 2.9 15.4 2.7L16.6 2.5Q17.6 2.3 17.9 3.3L18.3 4.4Q18.6 5.4 19.6 5.7L20.7 6.1Q21.7 6.4 21.5 7.4L21.3 8.6Q21.1 9.6 21.8 10.3L22.5 11.2Q23.2 12 22.5 12.8L21.8 13.7Q21.1 14.4 21.3 15.4L21.5 16.6Q21.7 17.6 20.7 17.9L19.6 18.3Q18.6 18.6 18.3 19.6L17.9 20.7Q17.6 21.7 16.6 21.5L15.4 21.3Q14.4 21.1 13.7 21.8L12.8 22.5Q12 23.2 11.2 22.5L10.3 21.8Q9.6 21.1 8.6 21.3L7.4 21.5Q6.4 21.7 6.1 20.7L5.7 19.6Q5.4 18.6 4.4 18.3L3.3 17.9Q2.3 17.6 2.5 16.6L2.7 15.4Q2.9 14.4 2.2 13.7L1.5 12.8Q0.8 12 1.5 11.2L2.2 10.3Q2.9 9.6 2.7 8.6L2.5 7.4Q2.3 6.4 3.3 6.1L4.4 5.7Q5.4 5.4 5.7 4.4L6.1 3.3Q6.4 2.3 7.4 2.5L8.6 2.7Q9.6 2.9 10.3 2.2Z'/%3E%3Cpath fill='none' stroke='%230f0c1a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M7.8 12.3l2.8 2.8 5.6-5.8'/%3E%3C/svg%3E"); }
h1 .verified { width: 0.6em; height: 0.6em; margin-left: 0.2em; vertical-align: 0.05em; }
.credit-icon {
  display: inline-block; flex: none; width: 1em; height: 1em; vertical-align: -0.14em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12.8' cy='13' r='10' fill='%23A86A00'/%3E%3Ccircle cx='11' cy='11' r='10' fill='%23FFC53D'/%3E%3Cpath d='M4.2 8.2A7.6 7.6 0 0 1 9 3.6' fill='none' stroke='%23FFE7A3' stroke-width='1.8' stroke-linecap='round'/%3E%3Cpath d='M14.4 8.2a4.6 4.6 0 1 0 0 5.6' fill='none' stroke='%238A5600' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.stage { flex: 1; position: relative; }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.stage .error { position: absolute; inset: 0; display: grid; place-content: center; gap: 14px; margin: 0; padding: 24px; text-align: center; color: #c7ccd6; font-size: 1.05rem; }
.stage .error p { margin: 0; }
.stage .error a { justify-self: center; padding: 10px 20px; border-radius: 12px; background: #ff2d9e; color: #15171c; font-weight: 800; text-decoration: none; }
.status { position: fixed; bottom: 6px; left: 12px; margin: 0; font-size: 0.8rem; color: #9aa1ad; }
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 100vw); box-sizing: border-box;
  padding: calc(env(safe-area-inset-top) + 16px) 18px 16px; background: rgba(20, 22, 28, 0.97); border-left: 1px solid rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: -18px 0 50px rgba(0, 0, 0, 0.45); overflow-y: auto; z-index: 30;
}
.panel-head { display: flex; align-items: center; gap: 8px; }
.panel-head h2 { font-size: 1.25rem; font-weight: 750; margin: 0 auto 0 0; }
/* buttons in the play page's panels: the menu's glass; the main action is pink (.primary), as Buy */
.panel button { min-height: 40px; padding: 0 16px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 12px; background: rgba(255, 255, 255, 0.06);
  color: #f2f3f6; font-size: 0.9rem; font-weight: 750; cursor: pointer; }
.panel button:hover, .panel button:focus-visible { background: rgba(255, 255, 255, 0.11); }
.panel button.primary { border-color: #ff2d9e; background: #ff2d9e; color: #15171c; font-weight: 800; }
.panel button.primary:hover, .panel button.primary:focus-visible { background: #ff2d9e; filter: brightness(1.08); }
.panel button:disabled { opacity: 0.55; cursor: default; }
.panel select { color: #f2f3f6; }
.panel .panel-close { min-height: 0; color: #f2f3f6; font-size: 0.95rem; }
.panel .panel-close { width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.06); }
.panel .panel-close:hover { background: rgba(255, 255, 255, 0.12); }
/* the leaderboard (js/shell.js boardRow, renderMe) */
.lb-game { margin: 4px 0 12px; }
.panel .lb-period { width: 100%; padding: 9px 40px 9px 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.12); background-color: rgba(255, 255, 255, 0.05); font-weight: 600; font-size: 0.92rem; }
.panel .lb-period:hover { border-color: rgba(255, 255, 255, 0.24); }
.lb-me { display: flex; align-items: center; gap: 12px; margin: 12px 0 14px; padding: 12px 14px; border-radius: 16px;
  border: 1px solid rgba(255, 45, 158, 0.35); background: linear-gradient(135deg, rgba(255, 45, 158, 0.1), rgba(255, 255, 255, 0.03)); }
.lb-me[hidden] { display: none; }
.lb-me-avatar { width: 44px; height: 44px; font-size: 20px; }
.lb-me-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.lb-me-text b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; }
.lb-me-text small { color: #c7ccd6; font-size: 0.8rem; }
.lb-me-rank { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.lb-me-rank b { font-size: 1.2rem; color: #f2f3f6; }
.lb-me-rank small { color: #ffd166; font-weight: 700; font-variant-numeric: tabular-nums; }
.panel .lb-signin { flex: none; padding: 8px 16px; border-radius: 10px; border: 0; background: #ff2d9e; color: #15171c; font-weight: 800; cursor: pointer; }
.board { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.board li { display: grid; grid-template-columns: 30px 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06); background: rgba(255, 255, 255, 0.035); font-size: 0.95rem; }
.board .rank { justify-self: center; display: grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%; color: #9aa1ad; font-weight: 700; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.board .top .rank { color: #15171c; }
.board .top1 .rank { background: linear-gradient(180deg, #ffe08a, #f0b429); }
.board .top2 .rank { background: linear-gradient(180deg, #eef1f6, #b8c0cc); }
.board .top3 .rank { background: linear-gradient(180deg, #f3b98a, #c97a3d); }
.board .top1 { border-color: rgba(255, 209, 102, 0.35); background: rgba(255, 209, 102, 0.07); }
.board .mine { border-color: rgba(255, 45, 158, 0.55); box-shadow: 0 0 0 1px rgba(255, 45, 158, 0.25) inset; }
.lb-avatar { width: 34px; height: 34px; font-size: 15px; }
.board .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.board .score { font-weight: 750; color: #ffd166; font-variant-numeric: tabular-nums; }
.board .empty { display: block; padding: 22px 12px; text-align: center; color: #9aa1ad; border-style: dashed; background: none; }
/* the play page's own dialogs (a purchase, a question, not enough credits, a report): the menu's glass, as the
   leaderboard: pink for the main action, gold for what it costs */
.confirm { width: min(400px, calc(100vw - 32px)); box-sizing: border-box; padding: 22px; border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px; background: rgba(20, 22, 28, 0.97); color: #e8eaef; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.55), 0 0 28px rgba(255, 255, 255, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.confirm::backdrop { background: rgba(6, 7, 10, 0.62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.confirm form { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.confirm p { margin: 0; }
.confirm-text { color: #f2f3f6; font-size: 1.08rem; font-weight: 650; line-height: 1.4; }
.confirm-text b { font-weight: 800; }
.confirm-price { color: #ffd166; font-weight: 800; white-space: nowrap; }
.confirm-desc { color: #c7ccd6; font-size: 0.92rem; line-height: 1.45; }
.confirm menu { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 0; margin: 8px 0 0; }
.confirm menu button, .dialog-link { min-height: 42px; padding: 0 20px; border-radius: 12px; font-size: 0.95rem; font-weight: 800; cursor: pointer; }
.confirm menu button { border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.06); color: #f2f3f6; }
.confirm menu button:hover, .confirm menu button:focus-visible { background: rgba(255, 255, 255, 0.11); }
.confirm menu button.primary { border-color: #ff2d9e; background: #ff2d9e; color: #15171c; }
.confirm menu button.primary:hover, .confirm menu button.primary:focus-visible { background: #ff2d9e; filter: brightness(1.08); }
.confirm menu button:focus-visible, .dialog-link:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.45); outline-offset: 2px; } /* Cancel has focus when it opens: the safe answer */
/* a button at work (shell.js setBusy): a spinner before its words, as the Studio's buttons have */
.spinner { display: inline-block; flex: none; width: 15px; height: 15px; margin-right: 8px; vertical-align: -2px; box-sizing: border-box;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; opacity: 0.8; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
button[aria-busy="true"] { cursor: progress; }
.confirm menu button:disabled { cursor: default; opacity: 0.6; }
.confirm menu button.primary[aria-busy="true"] { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 1.6s; } }
.panel-sub { color: #9aa1ad; font-size: 0.85rem; margin: 6px 0 14px; }
.plans { display: flex; flex-direction: column; gap: 12px; }
/* memberships: cards like the menu's and the leaderboard's own card; a plan you have is pink-edged */
.plan { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 16px; background: rgba(255, 255, 255, 0.045); }
.plan.member { border-color: rgba(255, 45, 158, 0.55); box-shadow: 0 0 0 1px rgba(255, 45, 158, 0.25) inset; background: linear-gradient(135deg, rgba(255, 45, 158, 0.1), rgba(255, 255, 255, 0.03)); }
/* the title, and the price beside it while both fit; a long price (a game's own currency, with its credits) goes under
   the title and wraps there, inside the card */
.plan-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 10px; }
.plan-title { min-width: 0; color: #f2f3f6; font-size: 1.05rem; font-weight: 800; overflow-wrap: anywhere; }
.plan-price { min-width: 0; color: #ffd166; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.plan-desc { margin: 0; color: #c7ccd6; font-size: 0.9rem; line-height: 1.45; }
.plan-desc:empty, .plan ul:empty { display: none; }
.plan ul { display: flex; flex-direction: column; gap: 5px; margin: 0; padding: 0; list-style: none; font-size: 0.9rem; }
.plan li::before { content: "✓"; margin-right: 8px; color: #ff2d9e; font-weight: 800; }
/* a membership's perks in its confirmation: one card, like the menu's */
.confirm-perks { display: flex; flex-direction: column; gap: 6px; margin: 2px 0; padding: 12px 14px; list-style: none; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08); background: rgba(255, 255, 255, 0.045); font-size: 0.9rem; }
.confirm-perks li::before { content: "✓"; margin-right: 8px; color: #ff2d9e; font-weight: 800; }
.plan-status { margin: 0; color: #ffd166; font-size: 0.85rem; font-weight: 700; }
.plan button { width: 100%; margin-top: 4px; }
.confirm-kicker { color: #ffd166; font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.confirm-perks:empty, .confirm-kicker:empty, .confirm-desc:empty, .confirm-balance:empty { display: none; }
.confirm-balance { color: #9aa1ad; font-size: 0.85rem; }
/* Get credits: the menu's gold Add */
.dialog-link { display: inline-flex; align-items: center; border: 0; background: linear-gradient(180deg, #ffe08a, #ffc43d); color: #15171c;
  text-decoration: none; box-shadow: 0 4px 14px rgba(255, 196, 61, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.dialog-link:hover, .dialog-link:focus-visible { filter: brightness(1.05); }

/* players panel (online play): who's in the room, chat, report and vote to remove; rows like the leaderboard's */
.mp-players { display: flex; flex-direction: column; gap: 8px; list-style: none; padding: 0; margin: 0 0 14px; }
.mp-players li { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 8px 10px; padding: 10px 12px; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06); background: rgba(255, 255, 255, 0.035); font-size: 0.92rem; }
.mp-players li.me { border-color: rgba(255, 45, 158, 0.55); box-shadow: 0 0 0 1px rgba(255, 45, 158, 0.25) inset; }
.mp-avatar { width: 34px; height: 34px; font-size: 15px; }
.mp-players .who { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mp-players .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: #f2f3f6; }
.mp-players .tags { color: #9aa1ad; font-size: 0.8rem; }
.mp-players .tags:empty { display: none; }
.mp-players .actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; }
.panel .mp-players .actions button { min-height: 30px; padding: 0 12px; border-radius: 10px; font-size: 0.8rem; }
.mp-heading { font-size: 0.8rem; color: #9aa1ad; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800; margin: 14px 0 8px; }
.mp-chat { display: flex; flex-direction: column; gap: 6px; list-style: none; padding: 0; margin: 0; max-height: 40vh; overflow-y: auto; font-size: 0.9rem; overflow-wrap: anywhere; }
.mp-chat li { padding: 7px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.045); }
.mp-chat li b { color: #f2f3f6; }
.mp-chat .empty { color: #9aa1ad; background: none; padding: 4px 0; }
.mp-chat-form { display: flex; gap: 8px; margin-top: 10px; }
.mp-chat-form input { flex: 1; min-width: 0; box-sizing: border-box; padding: 9px 12px; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 12px;
  background: rgba(255, 255, 255, 0.05); color: #f2f3f6; font: inherit; font-size: 0.92rem; }
.mp-chat-form input::placeholder { color: #9aa1ad; }
.confirm .field { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; font-weight: 600; color: #c7ccd6; }
.confirm .field select, .confirm .field textarea { box-sizing: border-box; width: 100%; padding: 9px 12px; border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px; background-color: rgba(255, 255, 255, 0.05); color: #f2f3f6; font: inherit; font-size: 0.92rem; font-weight: 500; }
.confirm .field textarea { resize: vertical; }
/* the play page's dropdowns draw their own arrow, inset like the numbers on the rows below (the browser's hugs the edge) */
.panel .lb-period, .confirm .field select { -webkit-appearance: none; appearance: none; cursor: pointer; background-repeat: no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%23c7ccd6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 14px center; background-size: 12px 8px; }
.confirm .field select { padding-right: 36px; background-position: right 12px center; }

/* the profile dialog (js/account.js GP.openProfile): a game's "Make it yours" opens it over the menu */
.rename-dialog { border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 22px; background: rgba(20, 22, 28, 0.97); color: #e8eaef; padding: 22px;
  width: min(420px, calc(100vw - 32px)); box-sizing: border-box; box-shadow: 0 20px 56px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.rename-dialog::backdrop { background: rgba(6, 7, 10, 0.62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.rename-dialog h2 { margin: 0 0 6px; color: #f2f3f6; font-size: 1.2rem; font-weight: 800; }
.rename-lede, .rename-hint { color: #c7ccd6; font-size: 0.9rem; margin: 0 0 14px; }
.rename-hint { margin: 8px 0 0; }
.rename-dialog label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.rename-dialog input { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 12px; background: rgba(255, 255, 255, 0.05); color: #f2f3f6; font: inherit; }
.rename-dialog input:focus { outline: none; border-color: rgba(255, 45, 158, 0.7); }
.rename-error { color: #ff8a8a; font-size: 0.9rem; margin: 10px 0 0; }
.rename-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.rename-actions button { min-height: 42px; padding: 0 20px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 12px; background: rgba(255, 255, 255, 0.06); color: #f2f3f6; font-size: 0.95rem; font-weight: 800; }
.rename-actions button:hover { background: rgba(255, 255, 255, 0.11); }
.rename-actions button.primary { border-color: #ff2d9e; background: #ff2d9e; color: #15171c; }
.rename-actions button.primary:hover { background: #ff2d9e; filter: brightness(1.08); }
.rename-actions button:disabled { opacity: 0.55; cursor: default; }

/* invites (js/shell.js): the note for a game that doesn't take invite links itself, and the players panel's copy button */
.invite-note { position: fixed; top: calc(env(safe-area-inset-top) + 56px); left: 50%; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); box-sizing: border-box; padding: 10px 12px 10px 16px; border-radius: 16px; background: rgba(20, 22, 28, 0.94); color: #f2f3f6; border: 1px solid rgba(255, 255, 255, 0.16); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); font-size: 0.9rem; }
.invite-note[hidden] { display: none; }
.invite-note button { flex: none; min-height: 34px; padding: 0 14px; border: 0; border-radius: 10px; background: #ff2d9e; color: #15171c; font: inherit; font-weight: 800; cursor: pointer; }
.invite-note #invite-close { min-height: 0; padding: 6px; background: none; color: #c7ccd6; font-weight: 400; }
.mp-invite-row { margin: -6px 0 14px; }

/* the profile dialog (js/account.js): the avatar grid above the username */
.profile-dialog { width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.profile-head .rename-lede { margin: 4px 0 0; }
.profile-avatar { width: 60px; height: 60px; font-size: 28px; }
.profile-label { font-weight: 700; font-size: 0.9rem; margin: 0 0 8px; }
.avatar-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin: 0 0 16px; padding: 2px; max-height: min(344px, 46dvh); overflow-y: auto; }
.avatar-choice { display: block; padding: 2px; border: 2px solid transparent; border-radius: 50%; background: none; cursor: pointer; aspect-ratio: 1; min-width: 0; }
.avatar-choice img { display: block; width: 100%; height: 100%; border-radius: 50%; }
.avatar-choice:hover { border-color: rgba(255, 255, 255, 0.28); }
.avatar-choice:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.6); outline-offset: 1px; }
.avatar-choice[aria-checked="true"] { border-color: #ff2d9e; box-shadow: 0 0 0 3px rgba(255, 45, 158, 0.25); }
@media (max-width: 420px) { .avatar-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); max-height: 232px; } } /* 4½ rows: there are more */
