/* The forge (loading screen), the "your game is ready" card, the change bar, and recent games.
   The forge uses the Studio's light theme; forge.js sets the --f-* accents from the game's own palette
   (darkened where needed so they read on white). The mine picture is mine.js. */

/* ── forge ── */
.state.forge {
  --f-a: #0b6a0b; --f-b: #0e7a0e; --f-c: #d6336c;
  --f-a-rgb: 109, 76, 255; --f-b-rgb: 10, 127, 143; --f-c-rgb: 214, 51, 108;
  display: flex; padding: 0; overflow-x: hidden; overflow-y: auto;
  background: #f3f2ee; color: #14151f; isolation: isolate;
  overflow-anchor: none; /* the title arriving must not shove the page down */
  align-items: flex-start; justify-content: center; /* taller than the panel: start at the top, never centre off-screen */
}
.studio-page .state.forge { background: #f3f2ee; }
.forge-bg { position: absolute; inset: 0 0 auto; height: 420px; z-index: -1; opacity: 0; pointer-events: none; filter: blur(40px) saturate(1.1);
  -webkit-mask-image: linear-gradient(#000, transparent); mask-image: linear-gradient(#000, transparent); }
.forge-bg svg { display: block; width: 100%; height: 100%; }
.forge-bg.in { opacity: 0.16; animation: forgeBgIn 1.4s ease; }
@keyframes forgeBgIn { from { opacity: 0; } to { opacity: 0.16; } }

.forge-inner { position: relative; width: min(980px, 100%); margin: 0 auto; padding: clamp(22px, 4vh, 40px) clamp(16px, 3vw, 32px) 32px; text-align: center; }

.forge-eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--f-a); }
.forge-title { margin: 0; min-height: 1.1em; font-size: clamp(32px, 5.6vw, 60px); line-height: 1.04; font-weight: 800; letter-spacing: -0.035em; color: #14151f; }
.forge-title.is-pending { font-size: clamp(22px, 3.2vw, 30px); font-weight: 600; letter-spacing: -0.01em; color: #80849a; animation: pulseText 2.2s ease-in-out infinite; }
.forge-title .word { display: inline-block; white-space: nowrap; }
.forge-title .ch { display: inline-block; }
.forge-title .ch.pop { animation: chIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i) * 45ms); }
@keyframes chIn { from { opacity: 0; transform: translateY(0.4em) scale(0.92); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes pulseText { 50% { opacity: 0.55; } }

.forge-tag { margin: 10px auto 0; max-width: 56ch; min-height: 1.5em; font-size: clamp(15px, 1.6vw, 17px); color: #5d6175; animation: fadeUp 0.8s 0.4s both; }
.forge-swatches { display: flex; justify-content: center; gap: 8px; margin-top: 14px; min-height: 20px; }
.forge-swatches i { width: 20px; height: 20px; border-radius: 50%; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #e4e3dd; animation: swatchIn 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.4) both; animation-delay: calc(var(--i) * 90ms + 0.5s); }
@keyframes swatchIn { from { opacity: 0; transform: scale(0.2); } to { opacity: 1; transform: scale(1); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* steps */
.forge-steps { list-style: none; display: flex; max-width: 540px; margin: 24px auto 0; padding: 0; }
.forge-steps li { position: relative; flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: #9a9aa8; transition: color 0.3s; }
.forge-steps li:not(:last-child)::before { content: ""; position: absolute; top: 7px; left: 50%; width: 100%; height: 2px; background: #e4e3dd; transition: background 0.5s; }
.forge-steps li.done:not(:last-child)::before { background: var(--f-a); }
.fs-dot { position: relative; z-index: 1; width: 16px; height: 16px; border-radius: 50%; background: #fcfcfb; border: 2px solid #d4d3cc; display: grid; place-items: center; font-size: 10px; line-height: 1; color: #fff; transition: background 0.3s, border-color 0.3s; }
.forge-steps li.done { color: #14151f; }
.forge-steps li.done .fs-dot { background: var(--f-a); border-color: var(--f-a); }
.forge-steps li.done .fs-dot::after { content: "✓"; font-weight: 800; }
.forge-steps li.active { color: #14151f; }
.forge-steps li.active .fs-dot { border-color: var(--f-a); animation: ring 1.8s ease-out infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(var(--f-a-rgb), 0.45); } 100% { box-shadow: 0 0 0 12px rgba(var(--f-a-rgb), 0); } }

/* the mine + meter */
.forge-mine { margin: 22px auto 0; overflow: hidden; border: 1px solid #e4e3dd; border-radius: 20px; background: #fcfcfb; box-shadow: 0 18px 40px -26px rgba(20, 21, 31, 0.35); }
.forge-mine canvas { display: block; width: 100%; height: clamp(170px, 24vh, 210px); }
.forge-meter { padding: 12px 18px 14px; }
.forge-bar { height: 6px; overflow: hidden; border-radius: 99px; background: #ecebe5; }
.forge-bar i { display: block; width: 0; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--f-a), var(--f-b)); }
.forge-meta { display: grid; grid-template-columns: 3.4ch 1fr 3.4ch; gap: 14px; align-items: baseline; margin-top: 9px; font-size: 13px; color: #5d6175; }
.fm-pct { font-weight: 700; color: #14151f; text-align: left; font-variant-numeric: tabular-nums; }
.fm-status { min-width: 0; overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.fm-time { text-align: right; font-variant-numeric: tabular-nums; }

/* cards */
.forge-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 18px; text-align: left; }
.forge-card { min-width: 0; padding: 18px 18px 16px; border: 1px solid #e4e3dd; border-radius: 18px; background: #fcfcfb; }
.forge-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: #80849a; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--f-a); box-shadow: 0 0 0 3px rgba(var(--f-a-rgb), 0.18); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

.bp-row { margin-bottom: 13px; animation: fadeUp 0.6s both; animation-delay: calc(var(--i) * 140ms); }
.bp-row:last-child { margin-bottom: 0; }
.bp-k { display: block; margin-bottom: 3px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--f-a); }
.bp-v { margin: 0; font-size: 14px; line-height: 1.5; color: #2b2d3a; }
.bp-list { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.5; color: #2b2d3a; }
.bp-chips span { display: inline-block; margin: 0 6px 6px 0; padding: 3px 10px; border: 1px solid rgba(var(--f-a-rgb), 0.3); border-radius: 99px; background: rgba(var(--f-a-rgb), 0.07); font-size: 12px; color: #2b2d3a; }
.bp-skel i { display: block; height: 12px; margin: 0 0 13px; border-radius: 6px; background: linear-gradient(90deg, #ecebe5, #f6f5f1, #ecebe5); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
.bp-skel i:nth-child(1) { width: 92%; } .bp-skel i:nth-child(2) { width: 74%; } .bp-skel i:nth-child(3) { width: 84%; } .bp-skel i:nth-child(4) { width: 48%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* the code view stays a dark editor so the code reads like code */
.forge-code pre { display: flex; flex-direction: column; justify-content: flex-end; height: 118px; margin: 0; padding: 10px 12px; overflow: hidden; white-space: pre; border-radius: 12px; background: #101a12; font: 11.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #b8e8b0;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 40%); mask-image: linear-gradient(to bottom, transparent, #000 40%); }
.forge-code pre:empty { justify-content: center; -webkit-mask-image: none; mask-image: none; background: #f3f2ee; }
.forge-code pre:empty::before { content: "Waiting for the first line of code…"; color: #9a9aa8; font-family: system-ui, sans-serif; font-size: 12.5px; text-align: center; }
.miles { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; min-height: 26px; }
.miles:empty::before { content: "Getting started…"; font-size: 12.5px; color: #9a9aa8; }
.miles li { padding: 3px 11px 3px 8px; border-radius: 99px; background: #f3f2ee; border: 1px solid #e4e3dd; font-size: 12px; color: #2b2d3a; }
.miles li::before { content: "✓"; margin-right: 6px; font-weight: 800; color: var(--f-a); }
.miles li.new { animation: milePop 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.3) both; }
.miles li[data-kind="write"]::before { content: "✎"; }
.miles li[data-kind="edit"]::before { content: "✎"; color: var(--f-c); }
.miles li[data-kind="playtest"]::before { content: "▶"; color: var(--f-b); }
.miles li[data-kind="note"]::before { content: "•"; }
.forge-test { grid-column: 1 / -1; }
.ft-round { font-weight: 600; letter-spacing: 0.08em; color: #9a9aa8; }
.ft-shots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ft-shots figure { margin: 0; animation: fadeUp 0.5s both; animation-delay: calc(var(--i) * 90ms); }
.ft-shots img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; border: 1px solid #e4e3dd; background: #000; }
.ft-shots figcaption { margin-top: 5px; font-size: 11.5px; color: #80849a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-verdict { margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: #2b2d3a; }
.ft-verdict.bad { color: #b4540a; }
.ft-verdict.good::before { content: "✓ "; font-weight: 800; color: #0e7a0e; }
@keyframes milePop { from { opacity: 0; transform: translateY(8px) scale(0.85); } to { opacity: 1; transform: none; } }

.forge-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; margin: 20px 0 0; font-size: 13px; color: #80849a; }
.forge-foot a { color: #14151f; text-decoration: underline; text-decoration-color: #c9c8c0; text-underline-offset: 3px; }
.forge-cancel { padding: 6px 15px; border: 1px solid #d4d3cc; border-radius: 99px; background: #fcfcfb; font: inherit; font-size: 13px; color: #5d6175; cursor: pointer; }
.forge-cancel:hover:not(:disabled) { border-color: #9a9aa8; color: #14151f; }
.forge-cancel:disabled { opacity: 0.4; cursor: default; }

/* play while you wait */
.wait { margin-top: 22px; padding-bottom: 8px; text-align: left; }
.wait-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.wait-head h3 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: #14151f; }
.wait-tabs { display: inline-flex; padding: 3px; border: 1px solid #e4e3dd; border-radius: 99px; background: #fcfcfb; }
.wait-tabs button { padding: 6px 14px; border: 0; border-radius: 99px; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: #5d6175; cursor: pointer; }
.wait-tabs button[aria-selected="true"] { background: #14151f; color: #fff; }
.wait-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.wait-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; border: 1px solid #e4e3dd; border-radius: 16px; background: #fcfcfb; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.wait-card:hover, .wait-card:focus-visible { transform: translateY(-2px); border-color: #c9c8c0; box-shadow: 0 14px 30px -18px rgba(20, 21, 31, 0.4); outline: none; }
.wait-art { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #e9e8e2; }
.wait-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.wait-art .wait-icon { position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; }
.wait-art::after { content: "▶"; position: absolute; right: 10px; bottom: 10px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: #14151f; background: rgba(255, 255, 255, 0.9); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); }
.wait-info { padding: 10px 12px 12px; }
.wait-info b { display: block; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wait-info span { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.4; color: #80849a; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wait-tag { display: inline-block; font-style: normal; margin-top: 6px; padding: 1px 8px; border-radius: 99px; background: #f3f2ee; font-size: 11px; font-weight: 600; color: #5d6175; }
.wait-empty { grid-column: 1 / -1; margin: 0; padding: 22px; border: 1px dashed #d4d3cc; border-radius: 14px; font-size: 13.5px; color: #80849a; text-align: center; }
.wait-empty button { margin-left: 4px; padding: 0; border: 0; background: none; font: inherit; color: #0b6a0b; text-decoration: underline; cursor: pointer; }

.wait-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 3vh 3vw; background: rgba(20, 21, 31, 0.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.wait-box { display: flex; flex-direction: column; width: min(1200px, 100%); height: min(820px, 100%); overflow: hidden; border-radius: 18px; background: #fcfcfb; box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.6); animation: cardIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.wait-bar { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 18px; border-bottom: 1px solid #e4e3dd; font-size: 14px; color: #14151f; }
.wait-bar b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wait-progress { margin-left: auto; font-size: 12.5px; color: #80849a; white-space: nowrap; }
.wait-x { width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; font-size: 24px; line-height: 1; color: #5d6175; cursor: pointer; }
.wait-x:hover { background: #f3f2ee; color: #14151f; }
.wait-box iframe { flex: 1; width: 100%; border: 0; background: #000; }

/* finished: a short flourish before the game opens */
.state.forge.complete .forge-bar i { background: linear-gradient(90deg, var(--f-a), #0e7a0e); }
.state.forge.complete .forge-eyebrow { color: #0e7a0e; }

@media (max-width: 760px) {
  .forge-grid { grid-template-columns: 1fr; }
  .forge-steps li { font-size: 12px; }
  .forge-foot { flex-direction: column; gap: 10px; }
  .ft-shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wait-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wait-modal { padding: 0; }
  .wait-box { border-radius: 0; height: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .state.forge *, .state.forge .forge-bg, .wait-box { animation: none !important; }
}

/* ── "your game is ready" card over the loaded game ── */
/* Opaque on purpose: the game boots behind this card, and its own title screen must not show through the text. */
.play-overlay { padding: 20px; background: radial-gradient(ellipse at 50% 40%, #101a12 0%, #05060d 75%); backdrop-filter: none; }
.po-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); grid-template-rows: minmax(0, 1fr); width: min(740px, 100%); max-height: 100%; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 22px; background: #0b0c17; color: #eef0ff; box-shadow: 0 50px 120px -30px rgba(0, 0, 0, 0.8); animation: cardIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }
.po-cover { min-height: 220px; position: relative; }
.po-cover svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.po-info { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 28px 28px 24px; text-align: left; min-height: 0; overflow-y: auto; }
/* A long controls list scrolls inside the card; the Play buttons stay at the bottom of it, so Play is always there to press. */
.po-sticky { position: sticky; bottom: 0; z-index: 1; align-self: stretch; margin-bottom: -24px; padding: 14px 0 24px; background: linear-gradient(rgba(11, 12, 23, 0), #0b0c17 16px); }
.po-eyebrow { margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: #9bf00b; }
.po-info h2 { margin: 0; font-size: clamp(26px, 4vw, 38px); line-height: 1.05; letter-spacing: -0.03em; color: #fff; }
.po-tag { margin: 0; font-size: 15px; color: rgba(238, 240, 255, 0.78); }
.po-controls { margin: 0; font-size: 12.5px; line-height: 1.5; color: rgba(238, 240, 255, 0.55); }
.po-controls:empty, .po-tag:empty { display: none; }
.po-remix { margin: 0; font-size: 13px; color: rgba(238, 240, 255, 0.62); }
.po-remix[hidden] { display: none; }
.po-info .btn { margin-top: 6px; }
.po-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.po-acts .btn { margin-top: 0; }
.po-share { background: rgba(255, 255, 255, 0.08); color: #fff; border: 1px solid rgba(255, 255, 255, 0.28); }
.po-share:hover { background: rgba(255, 255, 255, 0.16); }
.po-saved { margin: 2px 0 0; font-size: 12.5px; color: rgba(238, 240, 255, 0.5); }
.po-saved a { color: #fff; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, 0.35); }
@media (max-width: 640px) {
  .po-card { grid-template-columns: 1fr; grid-template-rows: auto; overflow-y: auto; }
  .po-cover { min-height: 130px; }
  .po-info { padding: 20px; overflow-y: visible; }
  .po-sticky { margin-bottom: -20px; padding-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) { .po-card { animation: none; } }

/* ── change a finished game ── */
.revise { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--panel); }
.revise-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.revise input[type="text"] { flex: 1 1 280px; min-width: 0; padding: 10px 14px; border: 1px solid #e4e3dd; border-radius: 10px; background: #f3f2ee; font: inherit; font-size: 14px; color: #14151f; }
.revise input[type="text"]::placeholder { color: #9a9aa8; }
.revise input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.revise .btn { white-space: nowrap; }
.revise-row > .btn { flex: none; }
.revise-refs { display: flex; flex-wrap: wrap; gap: 8px; }
.revise-ref { position: relative; width: 44px; height: 44px; border-radius: 8px; overflow: hidden; border: 1px solid #e4e3dd; }
.revise-ref img { width: 100%; height: 100%; object-fit: cover; display: block; }
.revise-ref button { position: absolute; top: 1px; right: 1px; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.65); color: #fff; font-size: 13px; line-height: 18px; cursor: pointer; }
.revise.over { outline: 2px dashed var(--accent); outline-offset: -4px; background: rgba(60, 160, 60, 0.06); }
.revise-hint { margin: 0; font-size: 12px; color: #9a9aa8; }
/* after a new game's first run: put it on the leaderboard? (studio/lb-ask.js) */
.lb-ask { flex: none; position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 44px 10px 14px; border-top: 1px solid var(--line); background: linear-gradient(rgba(155, 240, 11, 0.14), rgba(155, 240, 11, 0.14)), var(--panel); color: var(--text); }
.lb-ask[hidden] { display: none; }
.lb-ask.floating { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 60; max-width: 560px; margin: 0 auto; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); }
.lb-ask-q { margin: 0; flex: 1 1 260px; font-size: 14px; font-weight: 600; line-height: 1.4; }
.lb-ask-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.lb-ask-acts[hidden] { display: none; }
.lb-ask-acts .btn { margin-top: 0; }
.lb-ask-note { margin: 0; flex: 1 1 100%; font-size: 13px; line-height: 1.4; color: var(--text); }
.lb-ask-note:empty { display: none; }
.lb-ask-x { position: absolute; top: 2px; right: 2px; min-width: 40px; min-height: 40px; border: 0; background: none; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; opacity: 0.6; }
.lb-ask-x:hover { opacity: 1; }
/* a remix that just opened: ideas that fill the change box (studio/revise.js offerRemixIdeas) */
.remix-ideas { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.remix-ideas[hidden] { display: none; }
.remix-ideas-label { font-size: 13px; font-weight: 600; color: var(--text); }
.remix-idea { min-height: 36px; padding: 7px 13px; border-radius: 99px; border: 1px solid rgba(16, 124, 16, 0.35); background: rgba(155, 240, 11, 0.12); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.remix-idea:hover { background: rgba(155, 240, 11, 0.22); }
.remix-idea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.revise-hint.warn { color: #e0a070; }
@media (max-width: 480px) { .revise-row { flex-wrap: wrap; } .revise-row input[type="text"] { flex: 1 1 100%; } }

/* ── recent games on the empty stage ── */
.recent { margin-top: 28px; text-align: left; }
.recent-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.recent-head h3 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.recent-head a { font-size: 13px; color: #0b6a0b; font-weight: 600; }
.recent-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.rc { display: block; overflow: hidden; border: 1px solid #e4e3dd; border-radius: 14px; background: #fcfcfb; transition: transform 0.15s, box-shadow 0.15s; }
.rc:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -16px rgba(20, 21, 31, 0.4); }
.rc-art { aspect-ratio: 16 / 10; background: #0b0c17; }
.rc-art svg { display: block; width: 100%; height: 100%; }
.rc-t { padding: 8px 11px 9px; font-size: 13px; font-weight: 600; color: #14151f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-s { display: block; font-size: 11.5px; font-weight: 400; color: #80849a; }

/* pausing a build: the Pause button and the panel that replaces the progress while it is on hold */
.forge-pause { padding: 6px 15px; border: 1px solid #1f8f1f; border-radius: 99px; background: rgba(16, 124, 16, 0.08); font: inherit; font-size: 13px; font-weight: 600; color: #0b6a0b; cursor: pointer; }
.forge-pause:hover:not(:disabled) { background: rgba(16, 124, 16, 0.16); }
.forge-pause:disabled { opacity: 0.5; cursor: default; }
.forge-paused { margin: 18px auto 0; max-width: 560px; padding: 18px 20px; border: 1px solid #d4d3cc; border-radius: 18px; background: #fcfcfb; text-align: left; box-shadow: 0 18px 40px -28px rgba(20, 21, 31, 0.45); }
.forge-paused h3 { margin: 0 0 4px; font-size: 18px; color: #14151f; }
.forge-paused p { margin: 0 0 10px; font-size: 13.5px; color: #5d6175; }
.forge-paused textarea { width: 100%; resize: vertical; min-height: 78px; padding: 10px 12px; font: inherit; font-size: 14px; color: #14151f; background: #f3f2ee; border: 1px solid #e4e3dd; border-radius: 12px; }
.forge-paused textarea:focus { outline: 2px solid #1f8f1f; outline-offset: 1px; }
.fp-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.fp-actions .fp-count { margin-left: auto; }
.fp-count { font-size: 12px; color: #80849a; }
/* while paused the progress holds still */
.state.forge.is-paused .forge-mine, .state.forge.is-paused .forge-steps { opacity: 0.55; filter: grayscale(0.6); }
.state.forge.is-paused .fs-dot, .state.forge.is-paused .forge-bar i { animation-play-state: paused !important; }

/* the "Share to the leaderboard" box on the ready card of a new game: ticked, so Play shares it unless it is unticked */

/* a game's leaderboard (the Leaderboard button in the stage bar) */
.lb-card { width: min(440px, 100%); }
.lb-sub { margin: -4px 0 12px; color: var(--muted, #8f95b8); font-size: 14px; }
.lb-mine { margin: 0 0 10px; font-weight: 600; color: #0b6a0b; }
.lb-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; }
.lb-list li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: rgba(120, 124, 140, 0.1); }
.lb-list li.you { background: rgba(16, 124, 16, 0.14); box-shadow: inset 0 0 0 1px rgba(16, 124, 16, 0.45); }
.lb-rank { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name i { margin-left: 8px; padding: 1px 7px; border-radius: 99px; background: #107c10; color: #fff; font-size: 11px; font-style: normal; font-weight: 700; }
.lb-list b { font-variant-numeric: tabular-nums; }
.lb-empty { margin: 8px 0 12px; text-align: center; color: var(--muted, #8f95b8); }
.lb-note { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted, #8f95b8); }

/* full screen for the game you play while waiting: the whole window (game plus the progress bar) so "your game is ready" stays visible */
.wait-full { flex: none; width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 10px; background: transparent; color: #5d6175; cursor: pointer; }
.wait-full:hover { background: #f3f2ee; color: #14151f; }
.wait-full:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.wait-full .ic-exit, .wait-full[aria-pressed="true"] .ic-enter { display: none; }
.wait-full[aria-pressed="true"] .ic-exit { display: block; }
.wait-box:fullscreen { width: 100vw; height: 100vh; max-width: none; border-radius: 0; animation: none; }
.wait-box:-webkit-full-screen { width: 100vw; height: 100vh; max-width: none; border-radius: 0; animation: none; }
.wait-modal.expanded { padding: 0; }
.wait-modal.expanded .wait-box { width: 100%; height: 100%; border-radius: 0; animation: none; }

/* controls as key caps (controls-view.js) */
.po-controls.cv { display: grid; gap: 10px; font-size: 13px; color: rgba(238, 240, 255, 0.8); }
.cv-t { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(238, 240, 255, 0.5); margin-bottom: 4px; }
.cv-r { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.cv-k { display: inline-flex; flex-wrap: wrap; gap: 4px; flex: none; }
.cv-k kbd { min-width: 24px; padding: 2px 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.18); border-bottom-width: 2px; font: 600 12px/1.4 system-ui, sans-serif; text-align: center; color: #eef0ff; white-space: nowrap; }
.cv-a { color: rgba(238, 240, 255, 0.7); }
