/* The game (/play) inside the same frame as the public pages: header and footer aligned to the site container,
   the site links on desktop, one close button for every panel. Loaded last; it does not change the stage,
   the composer or their heights. */

/* Site links next to the wordmark (desktop only; phones keep the compact header). */

@media(min-width:900px) {



  .header-start { gap:28px; }
}

/* Header and footer share the site container from 1024px up, and grow with the screen like the other pages. */
@media(min-width:1024px) {
  /* The stage and the composer keep their own sizes, so the frame grows less than on the document pages. */
  :root { --u:clamp(.9px,min(.0695vw,.111vh),1.15px); }
  .app-header { padding-inline:max(32px,calc((100% - 1200 * var(--u)) / 2)); }
  .brand { font-size:calc(28 * var(--u)); }

  .header-actions .toolbar-button,.header-actions #account-button { font-size:calc(14 * var(--u));min-height:calc(42 * var(--u));padding-inline:calc(16 * var(--u)); }
  .header-actions .icon-button { width:calc(42 * var(--u));height:calc(42 * var(--u)); }
  .header-actions .icon-button svg { width:calc(20 * var(--u));height:calc(20 * var(--u)); }


}



/* One close button for every panel: same size, same icon, same hover. */
.close-dialog.icon-button,#activity-close { display:grid;place-items:center;width:40px;height:40px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--muted);font-size:0;transition:background 150ms var(--ease),color 150ms var(--ease); }
.close-dialog.icon-button svg,#activity-close svg { width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round; }
.close-dialog.icon-button:hover,#activity-close:hover { background:var(--soft);color:var(--text); }
.auth-close { right:14px;top:14px; }

/* Headings that receive focus from script do not draw a box around themselves. */
[tabindex='-1']:focus:not(:focus-visible),h2[tabindex='-1']:focus { outline:none; }

/* Verify: room for the round on desktop, so the first tab reads without an inner scroll. */
@media(min-width:900px) and (min-height:760px) { .verify-dialog { height:min(640px,78dvh);max-height:78dvh; } }

/* Sign-in when it is not available: a quiet notice under the heading instead of loose text. */
#account-dialog:not([data-step='signed-in']) #account-status:not(:empty):not([data-tone='error']) { margin:0 0 14px;padding:12px 14px;border-radius:12px;background:var(--soft);color:var(--muted);font-size:13px;line-height:1.5;text-align:center; }

/* Account panel, after the references (Privy, Linear, Polymarket): a mark, a title, one line, then either the
   sign-in field or the account card. Same elements and ids; account.js keeps writing into them. */
.auth-emblem { width:56px;height:56px;margin-bottom:18px;border-radius:16px;background:none;box-shadow:none; }
.auth-emblem svg { width:56px;height:56px; }
.auth-emblem rect { stroke:none; }


.auth-heading { margin-bottom:24px; }
.auth-heading h2 { font-size:28px; }
.auth-heading p { margin-top:6px; }

/* Signed in: one card with the account facts, actions as rows, sign out as a quiet link at the end. */
.account-dialog[data-step='signed-in'] .account-section { display:flex;flex-direction:column; }
.account-dialog[data-step='signed-in'] .account-tools { display:contents; }
.account-dialog[data-step='signed-in'] :is(#account-status,#account-summary,#beta-membership,#account-usage) { order:1;margin:0;padding:11px 14px;background:var(--bg);border:1px solid var(--border);border-top-width:0;font-size:13px;line-height:1.5;color:var(--text);text-align:left;border-radius:0; }
.account-dialog[data-step='signed-in'] #account-status { border-top-width:1px;border-radius:12px 12px 0 0;font-weight:500; }
.account-dialog[data-step='signed-in'] #account-usage { border-radius:0 0 12px 12px;color:var(--muted); }
.account-dialog[data-step='signed-in'] #beta-membership { color:var(--muted); }
.account-dialog[data-step='signed-in'] #account-status:empty+#account-summary { border-top-width:1px;border-radius:12px 12px 0 0; }
.account-dialog[data-step='signed-in'] :is(#account-conversation-wallet-field,#beta-invite-form) { order:2; }
.account-dialog[data-step='signed-in'] :is(#account-credits,#account-phantom,#account-wallet,#proving-round-account-send) { order:3;display:flex;align-items:center;justify-content:space-between;width:100%;min-height:48px;margin:8px 0 0;padding:0 16px;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--text);font-size:14px;font-weight:500;text-align:left; }
.account-dialog[data-step='signed-in'] :is(#account-credits,#account-phantom,#account-wallet,#proving-round-account-send)::after { content:none; }
.account-dialog[data-step='signed-in'] :is(#account-credits,#account-phantom,#account-wallet,#proving-round-account-send):hover { background:var(--soft); }
.account-dialog[data-step='signed-in'] #account-continue { order:4;margin-top:20px; }
.account-dialog[data-step='signed-in'] #account-mode-note { order:5;margin:12px 0 0;font-size:12px;line-height:1.5;color:var(--muted);text-align:center; }
.account-dialog[data-step='signed-in'] .account-data-note { order:6;display:flex;justify-content:center;gap:16px;margin:4px 0 0; }
.account-dialog[data-step='signed-in'] #account-logout { order:6;align-self:center;min-height:36px;margin:2px 0 0;padding:0 8px;border:0;background:none;color:var(--muted);font-size:12px;text-decoration:underline;text-underline-offset:3px; }
.account-dialog[data-step='signed-in'] .account-data-note a { color:var(--muted); }
/* The card's first action row sits a little under the facts. */
.account-dialog[data-step='signed-in'] #account-usage+* { margin-top:0; }
.account-dialog[data-step='signed-in'] .account-section::before { content:'';order:2;height:8px; }
/* Less to read while signing in: the placeholder names the field, and the code step says where the code went once. */
.account-dialog label[for='account-email'] { position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap; }
.account-dialog[data-step='code'] #account-description { display:none; }
.account-dialog[data-step='code'] .auth-heading { margin-bottom:16px; }
.account-dialog[data-step='code'] #account-change-email { margin-top:-14px; }

/* How to play: three short steps, one primary action, the two secondary actions side by side, then the details. */
#info-content:has(>.guide-steps) { display:flex;flex-wrap:wrap;gap:10px; }
#info-content:has(>.guide-steps)>* { flex:1 1 100%;margin:0; }
#info-content:has(>.guide-steps)>.guide-steps { order:1;margin-bottom:6px; }
#info-content:has(>.guide-steps)>.guide-mode { order:2; }
#info-content:has(>.guide-steps)>.guide-action:first-of-type { order:3; }
#info-content:has(>.guide-steps)>.guide-action:not(:first-of-type) { order:4;flex:1 1 0;justify-content:center;min-height:44px;border:1px solid var(--border);border-radius:12px;background:var(--surface);text-decoration:none;font-size:14px; }
#info-content:has(>.guide-steps)>.guide-details { order:5;margin-top:4px; }
#info-content:has(>.guide-steps)>.guide-footnote { order:6;text-align:center; }
@media(max-height:720px) { #info-content:has(>.guide-steps) .guide-steps p { display:none; } }

/* Bounty: a small chip over the number instead of a spaced mono caption. */
.live-bounty .bounty-eyebrow { display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:999px;background:var(--soft);font:500 12px var(--font);letter-spacing:0;text-transform:none;color:var(--muted); }
.live-bounty .bounty-indicator { width:6px;height:6px; }

/* The vault never grows past the room it has, so it cannot cover the bounty or the composer. */
:root main.chat-main[data-empty='true'] .guardian-poke { width:min(330px,94cqw,96cqh);height:min(330px,94cqw,96cqh); }

/* Short screens (a phone with the keyboard open, a low laptop window): the bounty goes compact and the attempts
   preview steps aside (Watch and Verify still have it), so the vault keeps a readable size. */
@media(max-height:760px) {
  :root main.chat-main[data-empty='true'] .arena-bar { height:auto;min-height:0;padding-block:6px; }
  :root main.chat-main[data-empty='true'] .arena-bar .live-bounty .bounty-eyebrow { display:none; }
  :root main.chat-main[data-empty='true'] #live-bounty-value { font-size:34px;letter-spacing:-1.4px; }
  :root main.chat-main[data-empty='true'] #live-bounty-note { margin-top:2px; }
  :root main.chat-main[data-empty='true'] #attempt-feed { display:none; }
}

/* Second way in, after the references (Privy, Linear): a quiet "or" and one outlined wallet button. */
.account-dialog .auth-divider { display:flex;align-items:center;gap:12px;margin:6px 0 0;color:var(--muted);font-size:12px; }
.account-dialog .auth-divider::before,.account-dialog .auth-divider::after { content:'';flex:1;height:1px;background:var(--border); }
.account-dialog .auth-secondary { display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:52px;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--text);font-size:14px;font-weight:500;transition:background 150ms var(--ease),border-color 150ms var(--ease); }
.account-dialog .auth-secondary svg { width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linejoin:round; }
.account-dialog .auth-secondary:hover:not(:disabled) { background:var(--soft);border-color:var(--text); }
.account-dialog .auth-secondary:disabled { opacity:.55;cursor:default; }
.account-dialog .auth-secondary[aria-busy='true'] svg { display:none; }
.account-dialog .auth-secondary[aria-busy='true']::before { content:'';width:13px;height:13px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:auth-spin 650ms linear infinite; }
.account-dialog .auth-secondary[hidden] { display:none!important; }
.account-dialog .auth-secondary[hidden]~*,.account-dialog .auth-divider:has(+.auth-secondary[hidden]) { display:none; }

/* Wallets, after the references (Privy, RainbowKit, Uniswap): one list of installed wallets with their own mark,
   a quiet "Detected" tag, and install suggestions only when the browser has none. */
.account-dialog .wallet-picker { display:flex;flex-direction:column;gap:8px; }
.account-dialog .wallet-group { margin:4px 0 0;font-size:12px;color:var(--muted); }
.account-dialog .wallet-list { display:flex;flex-direction:column;gap:8px; }
.account-dialog .wallet-option { display:flex;align-items:center;gap:12px;width:100%;min-height:56px;padding:0 14px;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--text);font-size:14px;font-weight:500;text-align:left;text-decoration:none;transition:background 150ms var(--ease),border-color 150ms var(--ease); }
.account-dialog .wallet-option:hover:not(:disabled) { background:var(--soft);border-color:var(--text);text-decoration:none; }
.account-dialog .wallet-option:disabled { cursor:default; }
.account-dialog .wallet-option:disabled:not([aria-busy='true']) { opacity:.5; }
.account-dialog .wallet-option[aria-busy='true'] { opacity:1;border-color:var(--text); }
.account-dialog .wallet-option .wallet-name { flex:1;min-width:0; }
.account-dialog .wallet-option .wallet-tag { font-size:12px;font-weight:400;color:var(--muted); }
.account-dialog .wallet-option[aria-busy='true'] .wallet-tag::before { content:'';display:inline-block;width:10px;height:10px;margin-right:7px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;vertical-align:-1px;animation:auth-spin 650ms linear infinite; }
.account-dialog .wallet-mark { display:grid;place-items:center;flex:none;width:32px;height:32px;border-radius:9px;background:var(--soft);box-shadow:inset 0 0 0 1px var(--border);font-size:14px;font-weight:600;color:var(--text);overflow:hidden; }
.account-dialog .wallet-mark img { width:100%;height:100%;object-fit:cover; }
.account-dialog .wallet-back { align-self:center;min-height:40px;margin-top:4px;font-size:12px;color:var(--muted);text-decoration:underline;text-underline-offset:3px; }
.account-dialog .wallet-picker [hidden] { display:none!important; }
.account-dialog[data-step='wallets'] :is(#account-summary,#account-wallets,#account-usage,#beta-membership,#account-mode-note,.account-data-note,.account-tools,#account-continue,#account-conversation-wallet-field,#beta-invite-form,#account-restore) { display:none!important; }
.account-dialog[data-step='wallets'] .auth-heading { margin-bottom:20px; }

/* Signed in: each wallet is a row of the account card, with copy and explorer at the end. */
.account-dialog:not([data-step='signed-in']) #account-wallets { display:none; }
.account-dialog .account-wallets { margin:0;padding:0;list-style:none; }
.account-dialog[data-step='signed-in'] #account-wallets { order:1;display:flex;flex-direction:column; }
.account-dialog .account-wallet { display:flex;align-items:center;gap:12px;padding:8px 6px 8px 14px;background:var(--bg);border:1px solid var(--border);border-top-width:0; }
.account-dialog .account-wallet .wallet-mark { width:28px;height:28px;border-radius:8px;font-size:12px; }
.account-dialog .account-wallet[data-kind='embedded'] .wallet-mark { background:var(--text);color:var(--bg);box-shadow:none; }
.account-dialog .wallet-text { display:flex;flex-direction:column;flex:1;min-width:0;line-height:1.35; }
.account-dialog .account-wallet .wallet-name { font-size:13px;font-weight:500;color:var(--text); }
body.vs .account-dialog .account-wallet .wallet-tag { margin-left:8px;padding:1px 7px;border-radius:999px;background:var(--soft);font-size:12px;font-weight:400;color:var(--muted); }
.account-dialog .wallet-address { font:12px var(--mono);color:var(--muted);font-variant-numeric:tabular-nums; }
.account-dialog .wallet-icon-button { display:grid;place-items:center;flex:none;width:34px;height:34px;padding:0;border:0;border-radius:8px;background:none;color:var(--muted);transition:background 150ms var(--ease),color 150ms var(--ease); }
.account-dialog .wallet-icon-button:hover { background:var(--soft);color:var(--text); }
.account-dialog .wallet-icon-button svg { width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round; }
.account-dialog .wallet-icon-button[data-copied='true'] { color:var(--text); }
.account-dialog .wallet-icon-button[data-copied='true'] svg { display:none; }
.account-dialog .wallet-icon-button[data-copied='true']::after { content:'✓';font-size:14px; }
/* "You're in." already says it: the signed-in line stays for screen readers when the wallets follow. */
.account-dialog[data-step='signed-in'] #account-summary:has(+#account-wallets:not([hidden])) { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0; }
.account-dialog[data-step='signed-in'] #account-status:empty~#account-wallets .account-wallet:first-child,
.account-dialog[data-step='signed-in'] #account-status:empty+#account-summary+#account-wallets .account-wallet:first-child { border-top-width:1px;border-radius:12px 12px 0 0; }

/* Contract mode (D-10): under the message box only the attempts left and "Wallet & details"; the rest of the wallet,
   round and transaction facts live in that sheet. After the references (Linear, Stripe): one quiet line, one panel. */
:root[data-contract-ui='on'] :is(#attempt-price,.composer-footnote:has(#connection-label),#notice-button) { display:none!important; }
.play-status { display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:36px;margin:8px 2px 0;font-size:13px;color:var(--muted); }
.play-status[hidden] { display:none; }
.play-credits,.play-problem { margin:0;min-width:0;line-height:1.4; }
.play-problem { color:var(--error); }
.play-credits[hidden],.play-problem[hidden] { display:none; }
.play-status #conversation-recover { margin-left:auto;min-height:32px;padding:0 12px;border-radius:999px; }
.play-details-button { display:inline-flex;align-items:center;gap:7px;flex:none;min-height:32px;padding:0 12px;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--text);font-size:12px;font-weight:500;transition:background 150ms var(--ease),border-color 150ms var(--ease); }
.play-details-button svg { width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linejoin:round; }
.play-details-button:hover { background:var(--soft);border-color:var(--text); }
.play-details-button[data-attention='true']::after { content:'';width:6px;height:6px;border-radius:50%;background:var(--signal); }

.wallet-sheet { width:440px;padding:24px; }
.wallet-sheet .dialog-heading { align-items:center;margin-bottom:8px; }
.wallet-sheet .dialog-heading h2 { margin:0; }
.wallet-sheet .sheet-section { padding:14px 0;border-top:1px solid var(--border); }
.wallet-sheet .sheet-section:first-of-type { border-top:0;padding-top:4px; }
.wallet-sheet .sheet-section[hidden] { display:none; }
.wallet-sheet h3 { margin:0 0 8px;font-size:12px;font-weight:500;color:var(--muted); }
.sheet-facts { display:grid;grid-template-columns:auto 1fr;gap:6px 16px;margin:0;font-size:13px; }
.sheet-facts dt { color:var(--muted); }
.sheet-facts dd { margin:0;text-align:right;font-variant-numeric:tabular-nums;overflow-wrap:anywhere; }
.sheet-note { margin:10px 0 0;font-size:12px;line-height:1.5;color:var(--muted); }
.sheet-note[hidden] { display:none; }
.wallet-sheet #conversation-wallet-balances { display:none; }
.wallet-sheet #conversation-wallet-actions,.wallet-sheet #conversation-exit-actions { display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:8px;margin:12px 0 0;padding:0;font-size:13px; }
.wallet-sheet #conversation-wallet-actions[hidden],.wallet-sheet #conversation-exit-actions[hidden] { display:none; }
.wallet-sheet #conversation-wallet-actions label { display:flex;align-items:center;gap:8px;width:100%;color:var(--muted);font-size:12px; }
.wallet-sheet #conversation-amount { flex:1;min-width:0;min-height:40px;padding:0 12px;border:1px solid var(--border);border-radius:10px;background:var(--bg);color:var(--text);font:14px var(--font); }
.wallet-sheet :is(#conversation-wallet-actions,#conversation-exit-actions,#sheet-pending-actions) .text-button { min-height:36px;padding:0 12px;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text);font-size:12px;text-decoration:none; }
.wallet-sheet :is(#conversation-wallet-actions,#conversation-exit-actions,#sheet-pending-actions) .text-button:hover:not(:disabled) { background:var(--soft); }
.wallet-sheet :is(#conversation-wallet-actions,#conversation-exit-actions) .text-button:disabled { opacity:.45; }
.wallet-sheet #sheet-pending-actions { display:flex;flex-wrap:wrap;gap:8px;margin-top:10px; }
.wallet-sheet #sheet-pending-actions:empty { display:none; }
.wallet-sheet .onramp { margin:12px 0 0; }
@media(max-width:540px) { .wallet-sheet { width:100%;max-width:calc(100vw - 16px);padding:20px; } .play-status { font-size:12px; } }

/* Message limit (O, 02/10): a thin bar under the text fills with the message's frame in bytes; from 90% a note says
   how much is left, and over the limit it says how much to cut and the arrow stays off. */
.composer { position:relative; }
.frame-meter { position:absolute;left:18px;right:18px;bottom:7px;height:3px;border-radius:999px;background:color-mix(in srgb,var(--border) 70%,transparent);overflow:hidden; }
.frame-meter[hidden] { display:none; }
.frame-meter span { display:block;height:100%;width:0;border-radius:inherit;background:var(--muted);transition:width 120ms linear,background 150ms var(--ease); }
.frame-meter[data-state='near'] span { background:var(--signal); }
.frame-meter[data-state='over'] span { background:var(--error); }
.frame-note { margin:6px 2px 0;font-size:12px;line-height:1.4;color:var(--muted);text-align:right; }
.frame-note[hidden] { display:none; }
.frame-note[data-state='over'] { color:var(--error); }
@media(prefers-reduced-motion:reduce) { .frame-meter span { transition:none; } }
/* Contract reviews (D-10): a card — what you do, what it costs, what happens next, one verb on the button — with the
   exact terms folded under "Technical details". Approve → deposit → open show their steps on top. */
.review-dialog { width:440px; }
.review-dialog .dialog-heading { margin-bottom:10px; }
.review-dialog .dialog-heading h2 { margin:0;font-size:22px; }
.review-progress { display:flex;gap:6px;margin:0 0 16px;padding:0;list-style:none;counter-reset:step; }
.review-progress[hidden] { display:none; }
.review-progress li { flex:1;min-width:0;padding:8px 10px;border-radius:10px;background:var(--soft);font-size:12px;line-height:1.35;color:var(--muted); }
.review-progress li span { display:block; }
.review-progress li span:first-child { font-weight:500;color:var(--text); }
.review-progress li[data-state='current'] { background:var(--surface);box-shadow:inset 0 0 0 1.5px var(--text); }
.review-progress li[data-state='done'] span:last-child { color:var(--success); }
.review-progress li[data-state='done'] span:last-child::before { content:'✓ '; }
.review-progress li[data-state='failed'] span:last-child { color:var(--error); }
.review-progress li[data-state='todo'] span:first-child { color:var(--muted); }
.review-dialog:is([data-phase='wallet'],[data-phase='confirming']) .review-progress li[data-state='current'] span:last-child::before { content:'';display:inline-block;width:9px;height:9px;margin-right:6px;border:1.5px solid currentColor;border-right-color:transparent;border-radius:50%;vertical-align:-1px;animation:auth-spin 650ms linear infinite; }
.review-summary { margin:0 0 14px!important;font-size:15px!important;line-height:1.5!important;color:var(--text)!important; }
.review-message { margin:0 0 14px;padding:12px 14px;border-left:3px solid var(--text);border-radius:0 10px 10px 0;background:var(--soft);font-size:14px;line-height:1.55;color:var(--text);white-space:pre-wrap;overflow-wrap:anywhere;max-height:30dvh;overflow:auto; }
.review-facts { display:grid;grid-template-columns:auto 1fr;gap:8px 16px;margin:0;padding:12px 14px;border:1px solid var(--border);border-radius:12px;font-size:13px; }
.review-facts dt { color:var(--muted); }
.review-facts dd { margin:0;text-align:right;font-variant-numeric:tabular-nums;overflow-wrap:anywhere; }
.review-dialog [hidden] { display:none!important; }
.review-next { margin:12px 0 0!important;font-size:13px!important;line-height:1.5!important;color:var(--muted)!important; }
.review-technical { margin:12px 0 0;font-size:12px;color:var(--muted); }
.review-technical summary { cursor:pointer;min-height:32px;display:flex;align-items:center;gap:6px;list-style:none; }
.review-technical summary::-webkit-details-marker { display:none; }
.review-technical summary::after { content:none;transition:transform 150ms var(--ease); }
.review-technical[open] summary::after { transform:rotate(90deg); }
body.vs .review-technical .review-facts { margin:6px 0 8px;padding:10px 12px;font:12px/1.5 var(--font); }
.review-technical #conversation-review-terms { margin:0;font-size:12px;line-height:1.6;overflow-wrap:anywhere; }
.review-status { margin:14px 0 0;padding:10px 12px;border-radius:10px;background:var(--soft);font-size:13px;line-height:1.5; }
.review-status[data-tone='error'] { background:var(--error-bg);color:var(--error); }
.review-dialog .dialog-actions { margin-top:18px; }
.review-dialog #conversation-confirm-review { min-width:180px; }
.review-dialog #conversation-confirm-review[aria-busy='true'] { opacity:.6; }
@media(max-width:540px) { .review-dialog { width:100%;padding:20px; } body.vs .review-progress li { padding:7px 8px;font-size:12px; } .review-dialog #conversation-confirm-review { flex:1;min-width:0; } }

/* The reply (D-10): your message on top of the bubble, the guardian thinking with the seconds so far, then the reply
   with its verdict, the bounty after the attempt and the next price. With messages the vault gives up some size so
   vault, reply and message box share one screen. */
:root[data-contract-ui='on'] .chat-main[data-empty='false'] .last-prompt:not([hidden]) { display:flex;align-items:baseline;gap:8px;width:100%;margin:0 0 10px;padding:0 0 10px;border:0;border-bottom:1px solid var(--border);background:none;color:var(--muted);font-size:13px;line-height:1.45;text-align:left;cursor:pointer; }
:root[data-contract-ui='on'] .last-prompt span:first-child { flex:none;font-weight:500;color:var(--text); }
:root[data-contract-ui='on'] .last-prompt #last-prompt-text { display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-width:0; }
:root[data-contract-ui='on'] .last-prompt span:last-child { flex:none;margin-left:auto; }
:root[data-contract-ui='on'] #guardian-receipt { display:none; }
.guardian-wait { display:flex;align-items:center;gap:10px;margin:10px 0 0;font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums; }
.guardian-wait[hidden],.guardian-outcome[hidden] { display:none; }
.guardian-dots { display:inline-flex;gap:4px; }
.guardian-dots i { width:6px;height:6px;border-radius:50%;background:var(--text);opacity:.25;animation:guardian-dot 1.2s ease-in-out infinite; }
.guardian-dots i:nth-child(2) { animation-delay:.15s; }
.guardian-dots i:nth-child(3) { animation-delay:.3s; }
@keyframes guardian-dot { 0%,80%,100% { opacity:.25;transform:translateY(0); } 40% { opacity:1;transform:translateY(-3px); } }
.guardian-outcome { display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;margin:12px 0 0;font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums; }
.guardian-verdict { display:inline-flex;align-items:center;min-height:24px;padding:0 10px;border-radius:999px;background:var(--soft);color:var(--text);font-size:12px;font-weight:600; }
.guardian-verdict[data-decision='released'] { background:var(--signal);color:var(--on-signal); }
@media(prefers-reduced-motion:reduce) { .guardian-dots i { animation:none;opacity:.6; } }
@media(min-width:761px) {
  :root[data-contract-ui='on'] .workspace .chat-main[data-empty='false'] .guardian-character { width:min(400px,36svh,44vw,calc(100% - 28px)); }
  :root[data-contract-ui='on'] .chat-main[data-empty='false'] #guardian-line { font-size:20px;line-height:1.5; }
}
/* Phones: the reply leads. A small vault, your message on one line, Copy and Share in the transcript. */
@media(max-width:760px) {
  :root[data-contract-ui='on'] .workspace .chat-main[data-empty='false'] .guardian-character { width:min(150px,19svh,calc(100% - 28px)); }
  :root[data-contract-ui='on'] .chat-main[data-empty='false'] #guardian-line { font-size:16px;line-height:1.5; }
  :root[data-contract-ui='on'] .chat-main[data-empty='false'] .guardian-bubble-actions { display:none!important; }
  :root[data-contract-ui='on'] .chat-main[data-empty='false'] #live-bounty-note { display:none; }
  :root[data-contract-ui='on'] .last-prompt #last-prompt-text { -webkit-line-clamp:1; }
  :root[data-contract-ui='on'] .chat-main[data-empty='false'] .last-prompt:not([hidden]) { margin-bottom:8px;padding-bottom:8px; }
  .guardian-outcome { margin-top:10px;gap:6px 8px;font-size:12px; }
  /* Your message on top of the bubble opens the transcript, so the separate Transcript row steps aside. */
  :root[data-contract-ui='on'] .chat-main[data-empty='false'] .guardian-controls { display:none; }
  :root[data-contract-ui='on'] .chat-main[data-empty='false'] :is(.conversation-area,.guardian-stage,.guardian-scene) { gap:12px; }
  /* After the first message the step chips are not needed: the next-step button already names the step. */
  :root[data-contract-ui='on'] .chat-main[data-empty='false'] #play-steps { display:none!important; }
}
@media(max-width:760px) and (max-height:760px) {
  :root[data-contract-ui='on'] .workspace .chat-main[data-empty='false'] .guardian-character { width:min(96px,13svh); }
  :root[data-contract-ui='on'] .chat-main[data-empty='false'] .arena-bar { padding-block:4px; }
  /* Short phones: a long reply scrolls inside the bubble instead of pushing the message box off screen. */
  :root[data-contract-ui='on'] .chat-main[data-empty='false'] #guardian-line { max-height:22svh;overflow-y:auto;overscroll-behavior:contain; }
}
/* In contract mode the message-limit note shows in the attempts line (see renderStatus). */
.play-credits[data-state='near'] { color:var(--signal); }
.play-credits[data-state='over'] { color:var(--error); }
/* Motion that explains the way in (approve → deposit → open): a rail fills with the steps done, the current step
   breathes, and the line under the box says what this step does. Reduced motion stops all of it (styles.css). */
.play-steps { position:relative; }
.play-steps::before,.play-steps::after { content:'';position:absolute;left:4px;right:4px;bottom:-5px;height:2px;border-radius:2px; }
.play-steps::before { background:var(--border); }
.play-steps::after { background:var(--signal);transform:scaleX(0);transform-origin:left;transition:transform .7s var(--ease); }
.play-steps[data-done='1']::after { transform:scaleX(.34); }
.play-steps[data-done='2']::after { transform:scaleX(.67); }
.play-steps li { display:inline-flex;align-items:center;gap:6px;transition:color .3s var(--ease); }
.play-steps li[data-state='current']::before { content:'';width:6px;height:6px;border-radius:50%;background:var(--signal);flex:none;animation:step-breathe 1.8s var(--ease) infinite; }
.play-steps li[data-state='done'] { animation:step-done .45s var(--ease) both; }
@keyframes step-breathe { 0%,100% { box-shadow:0 0 0 0 color-mix(in srgb,var(--signal) 50%,transparent); } 60% { box-shadow:0 0 0 5px transparent; } }
@keyframes step-done { from { opacity:.4;transform:translateY(2px); } }
.play-step-note { margin:10px 4px 0;font-size:12.5px;line-height:1.45;color:var(--muted);text-wrap:pretty; }
.play-step-note[hidden] { display:none; }
.play-step-note[data-fresh='a'] { animation:note-in .45s var(--ease) both; }
.play-step-note[data-fresh='b'] { animation:note-in-b .45s var(--ease) both; }
@keyframes note-in { from { opacity:0;transform:translateY(4px); } }
@keyframes note-in-b { from { opacity:0;transform:translateY(4px); } }
/* The verdict arrives instead of appearing; an opened vault glows once and its next step (withdraw) keeps a slow pulse. */
.guardian-outcome:not([hidden]) { animation:note-in .5s var(--ease) both; }
.guardian-verdict[data-decision='released'] { animation:verdict-glow 1.6s var(--ease) .15s both; }
@keyframes verdict-glow { 0% { transform:scale(.9);box-shadow:0 0 0 0 color-mix(in srgb,var(--signal) 60%,transparent); }
  30% { transform:scale(1.06); } 100% { transform:scale(1);box-shadow:0 0 0 14px transparent; } }
.next-step[data-action='withdraw']:not(:disabled) { background:var(--signal);color:var(--on-signal);animation:withdraw-call 2.6s var(--ease) infinite; }
@keyframes withdraw-call { 0%,100% { box-shadow:0 0 0 0 color-mix(in srgb,var(--signal) 40%,transparent); } 50% { box-shadow:0 0 0 7px transparent; } }
@media(max-width:760px) {
  :root[data-contract-ui='on'] .chat-main[data-empty='false'] #play-step-note { display:none; }
}
/* A line written by the game, not by the guardian (refunded error, verdict without reply text). */
#guardian-line[data-voice='system'] { color:var(--muted);font-style:italic;font-size:.92em; }
/* Leftover credits after a finished conversation: a quiet way home next to "Wallet & details". */
.play-withdraw { margin-left:auto;min-height:32px;padding:0 12px;border:1px solid var(--signal);border-radius:999px;background:transparent;color:var(--text);font-size:12px;font-weight:600;white-space:nowrap; }
.play-withdraw:hover:not(:disabled) { background:color-mix(in srgb,var(--signal) 14%,transparent); }
.play-withdraw[hidden] { display:none; }
.play-withdraw:not([hidden]) + .play-details-button { margin-left:0; }
@media(max-width:540px) {
  /* With a withdraw button too, the status line takes its own row and the two buttons share the next one. */
  .play-status:has(.play-withdraw:not([hidden])) { flex-wrap:wrap;row-gap:8px; }
  .play-status:has(.play-withdraw:not([hidden])) .play-credits { flex-basis:100%; }
  .play-withdraw { margin-left:0; }
}


body.vs #account-button { min-height:44px; min-width:44px; border:0; background:var(--surface); color:var(--text); font-weight:500; box-shadow:inset 0 1px 0 var(--key-hi), 0 1px 2px var(--key-lo), 0 0 0 1px var(--line); }
body.vs .live-bounty .bounty-eyebrow { background:none; padding:0; font:500 13px var(--font); letter-spacing:0; }
body.vs .live-bounty .bounty-figure strong { font-family:var(--display); font-weight:700; letter-spacing:-.03em; font-variant-numeric:proportional-nums; }
body.vs .composer { border-color:var(--control-border); border-radius:16px; transition:none; }
body.vs .composer:hover { border-color:var(--control-border-hover); }
body.vs .composer:focus-within { border-color:var(--control-border); box-shadow:none; outline:2px solid var(--text); outline-offset:2px; }
body.vs .composer textarea { border:0; }
body.vs :is(.send-button,.next-step):disabled { color:var(--muted); }
body.vs .play-credits[data-state='near'] { color:var(--warning); }
body.vs :is(#conversation-recover,#reply-reveal,.chat-main[data-empty='false'] .guardian-bubble-actions button),
body.vs .wallet-sheet :is(#conversation-wallet-actions,#conversation-exit-actions,#sheet-pending-actions) .text-button { min-height:44px; min-width:44px; }
body.vs :is(#info-eyebrow,.game-eyebrow,.treasury-label,.conversation-generation,.attempt-decision,.attempt-message strong) {
  font:500 13px/1.5 var(--font); letter-spacing:0; text-transform:none; }
/* The dialog labels arrive in capitals from details.js; set them in sentence case here. */
body.vs #info-eyebrow { display:inline-block; text-transform:lowercase; color:var(--muted); }
body.vs #info-eyebrow::first-letter { text-transform:uppercase; }
@media (hover:hover) and (pointer:fine) { body.vs #account-button:hover:not(:active) { box-shadow:inset 0 1px 0 var(--key-hi), 0 2px 6px var(--key-lo), 0 0 0 1px var(--muted); } }
/* Krek's face (sign in): the same face as the vault and the tab icon; it glances and blinks now and then. */
.krek-face svg { width:64px; height:64px; overflow:visible; }
.krek-face .face-ring { fill:#9b9a9e; } .krek-face .face-plate { fill:#18181b; }
.krek-face .face-eye { fill:#f2f1ec; } .krek-face .face-pupils { fill:#141416; } .krek-face .face-lid { fill:#18181b; }
.auth-emblem.krek-face { width:64px; height:64px; border-radius:50%; }
.auth-emblem.krek-face circle { stroke:none; }
/* The generic emblem rule paints circles in the text colour, which in dark mode turned the pupils white. */
.krek-face .face-pupils circle { fill:#141416; }
.krek-face .face-pupils { animation:krek-glance 4.2s cubic-bezier(.45,0,.2,1) infinite; }
.krek-face .face-eyes { transform-box:fill-box; transform-origin:50% 55%; animation:krek-blink 4.2s steps(1) infinite; }
/* The same loop as the 404 page and the favicon: one side, the other, back, and a blink. */
@keyframes krek-glance { 0%,12% { transform:translateX(0); } 22%,40% { transform:translateX(-4px); } 52%,70% { transform:translateX(4px); } 82%,100% { transform:translateX(0); } }
@keyframes krek-blink { 0%,90%,94%,100% { transform:scaleY(1); } 91%,93% { transform:scaleY(.1); } }
@media (prefers-reduced-motion:reduce) { .krek-face :is(.face-pupils,.face-eyes) { animation:none; } }
/* No numbering or mono tags in the game either: steps are spaced, the unit and the demo label are plain text. */
body.vs .game-guide .guide-steps li { padding-left:0; }
body.vs .game-guide .guide-steps li::before { content:none; }
body.vs #live-bounty-unit { font:500 13px var(--font); letter-spacing:0; }
body.vs .vault-demo-label>span { font:500 12px var(--font); letter-spacing:0; border-radius:6px; }
/* Disclosures say what they do instead of a plus sign. */
body.vs :is(.game-guide .guide-details summary,.settings-details summary)::after { content:'Show'; font:500 13px var(--font); color:var(--muted); transform:none!important; }
body.vs :is(.game-guide .guide-details[open] summary,.settings-details[open] summary)::after { content:'Hide'; }
body.vs .attempt-details summary:before { content:none; }
/* The top bar has no edge: no rule and no band of its own colour over the page (the dark game sits on a gradient). */
body.vs .app-header { border-bottom:0; background:transparent; }
/* Wallet & details: values in the page's own type, sections parted by space instead of a rule. The play steps
   name the action without numbers; the rail under them still fills as each one is done. */
body.vs .wallet-sheet .sheet-section { border-top:0; padding-top:18px; }
body.vs .wallet-sheet :is(dd,code,.wallet-address,.sheet-value) { font-family:var(--font); font-variant-numeric:proportional-nums; letter-spacing:0; }
body.vs .wallet-sheet #conversation-amount { font-family:var(--font); }
body.vs .wallet-sheet h3 { font:600 13px var(--font); color:var(--text); }
body.vs .account-dialog .wallet-address { font-family:var(--font); }
body.vs #play-steps li[data-state='current'] { color:var(--text); font-weight:600; }
/* The bounty reads as one number at every width: proportional figures, never split. */
body.vs #live-bounty-value { font-family:var(--font); font-weight:700; font-variant-numeric:proportional-nums; letter-spacing:-.03em; }
/* Narrow phones: the bounty note wraps to a second line instead of ending in an ellipsis. */
@media (max-width:420px) { body.vs #live-bounty-note { white-space:normal; overflow:visible; text-wrap:balance; text-align:center; } }
/* The header keys keep a finger's width between them on narrow phones. */
body.vs .header-actions { gap:8px; }
/* A contract round has one guardian: no model to choose, so no picker in the composer. */
html[data-conversation-mode='contract-v2'] body.vs #model-button { display:none; }
html[data-conversation-mode='contract-v2'] body.vs .send-area { margin-left:auto; }
