@font-face {
  font-family:"DM Sans";
  src:url("/ui/fonts/dm-sans-latin.woff2") format("woff2");
  font-style:normal;
  font-weight:100 1000;
  font-display:swap;
}

:root {
  color-scheme:light;
  --ink:#182923;
  --muted:#53665c;
  --line:#d6ded5;
  --paper:#f5f6ef;
  --card:#fcfdf8;
  --pine:#19392e;
  --lime:#cbf582;
  --accent:#3f693c;
  --error:#9d332d;
  font-family:"DM Sans",system-ui,sans-serif;
  font-size:15px;
  color:var(--ink);
  background:var(--paper);
  scroll-behavior:smooth;
}

* {
  box-sizing:border-box;
}

[hidden] {
  display:none!important;
}

body {
  margin:0;
  min-height:100vh;
}

a {
  color:inherit;
}

button,input,select {
  font:inherit;
}

button,.button {
  cursor:pointer;
  border:1px solid transparent;
  border-radius:7px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.7em;
  font-weight:650;
  font-size:.89rem;
  min-height:40px;
  padding:9px 15px;
  text-decoration:none;
}

button:disabled {
  cursor:default;
  opacity:.5;
}

a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible {
  outline:3px solid #538cda;
  outline-offset:3px;
}

button:not(:disabled):hover,.button:hover {
  filter:brightness(.95);
}

.topbar {
  height:70px;
  border-bottom:1px solid var(--line);
  background:var(--card);
  padding:0 clamp(20px,5.4vw,88px);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.mast,.account,.release-actions,.inline-input,.dialog-heading,.dialog-actions,.limit-footer {
  display:flex;
  align-items:center;
}

.mast,.account {
  gap:16px;
}

.brand {
  display:flex;
  align-items:center;
  gap:9px;
  text-decoration:none;
  font-size:25px;
  letter-spacing:-1.8px;
  font-weight:820;
}

.mark {
  width:25px;
  height:25px;
  display:inline-block;
  background:var(--pine);
  clip-path:polygon(0 100%,0 0,25% 0,25% 15%,40% 15%,40% 30%,55% 30%,55% 45%,70% 45%,70% 0,100% 0,100% 100%,75% 100%,75% 85%,60% 85%,60% 70%,45% 70%,45% 55%,30% 55%,30% 100%);
}

.arrow {
  display: inline-block;
  width: .78em;
  height: .78em;
  position: relative;
}
.arrow::before {
  content: "";
  position: absolute;
  width: .55em;
  height: .55em;
  top: 0;
  right: 0;
  border-top: 1.6px solid currentColor;
  border-right: 1.6px solid currentColor;
}
.arrow::after {
  content: "";
  position: absolute;
  top: 47%;
  left: 5%;
  width: 100%;
  border-top: 1.6px solid currentColor;
  transform: rotate(-45deg);
}

.product {
  padding-left:16px;
  border-left:1px solid var(--line);
  color:var(--muted);
  font-size:.9rem;
}

.pill {
  display:inline-flex;
  align-items:center;
  gap:7px;
  border-radius:99px;
  font-size:.8rem;
  font-weight:650;
  padding:5px 10px;
  line-height:1.2;
}

.pill:before {
  content:"";
  width:6px;
  height:6px;
  background:currentColor;
  border-radius:50%;
}

.account {
  font-size:.82rem;
  color:var(--muted);
}

.quiet,.text-button {
  color:var(--ink);
  background:transparent;
}

.quiet {
  border-color:var(--line);
}

main {
  width:min(1140px,100%);
  margin:0 auto;
  padding:clamp(22px,3vw,38px) clamp(18px,4vw,48px) 64px;
}

#loading {
  color:var(--muted);
}

#feedback,.release-error,.inline-error {
  padding:12px 14px;
  border-radius:7px;
  line-height:1.45;
  margin:0 0 18px;
  background:#e4f1d6;
  border:1px solid #b1d197;
}

#feedback[data-error=true],.release-error,.inline-error {
  background:#fcf0eb;
  border-color:#e5beb3;
  color:var(--error);
}

.eyebrow,.metric-label,.facts span {
  color:var(--muted);
  font-size:.72rem;
  letter-spacing:.07em;
  font-weight:700;
  text-transform:uppercase;
}

.primary {
  background:var(--lime);
  color:#192f22;
  border-color:#b4df72;
}

.secondary {
  color:var(--ink);
  background:#eef1e8;
  border-color:#ced8cb;
}

.secondary:hover {
  background:#e4eadc;
}

h1,h2,p {
  margin:0;
}

h1,h2 {
  line-height:1.08;
  letter-spacing:-.055em;
}

h1 {
  font-size:clamp(38px,5vw,60px);
  font-weight:690;
}

h2 {
  font-size:clamp(23px,3.2vw,34px);
  font-weight:660;
}

p {
  line-height:1.52;
  color:var(--muted);
}

.workspace-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
}

.workspace-heading:has(.gallery-actions:not([hidden])) { flex-wrap:wrap; }
.gallery-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }

.workspace-heading h1 {
  margin-top:7px;
}

.sections {
  display:flex;
  gap:clamp(14px,3.4vw,35px);
  border-bottom:1px solid var(--line);
  margin:0 0 26px;
}

.sections a {
  display:block;
  padding:0 0 12px;
  text-decoration:none;
  color:var(--muted);
  font-size:.9rem;
  white-space:nowrap;
}

.sections a[aria-current=page] {
  color:var(--ink);
  box-shadow:0 2px var(--pine);
}

.sections a:hover {
  text-decoration:underline;
}

.overview,.panel {
  scroll-margin-top:20px;
}

.overview-title {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  margin-bottom:12px;
}

.overview-title select {
  font-size:.95rem;
  width:auto;
  max-width:min(100%,360px);
  margin:0;
  padding:6px 29px 6px 9px;
  min-height:34px;
}

.release-card {
  background:var(--pine);
  color:#eef7e7;
  position:relative;
  isolation:isolate;
  overflow:hidden;
  border-radius:12px;
}

.release-card {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);
  min-height:260px;
}
.release-info {
  padding:clamp(22px,3.2vw,42px);
  align-self:center;
}
.release-info h2 {
  margin:13px 0 8px;
  font-size:clamp(30px,3.4vw,48px);
  overflow-wrap:anywhere;
}
.release-info p {
  color:#d3e2d5;
}

.release-info .eyebrow {
  color:#b4cbb6;
}

.release-actions {
  flex-wrap:wrap;
  gap:10px;
  margin:18px 0 0;
}

.pill {
  color:#e1edd9;
  border:1px solid #719382;
  white-space:nowrap;
}

.pill[data-state=live] {
  background:#d8f4ac;
  color:#274f35;
  border-color:transparent;
}

.outline-light {
  color:#eaf1e6;
  border-color:#759585;
  background:transparent;
}

.release-art {
  position:relative;
  min-height:210px;
  background:#244335;
  overflow:hidden;
}
.release-art canvas,.release-art img {
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}
.release-art canvas { image-rendering:pixelated; }
.release-art canvas,.release-art img { position:absolute; inset:0; }
.release-art img[data-kind=asset] { object-fit:contain; background:#e3e9dc; }
.project-overview {
  display:grid; grid-template-columns:minmax(0,1.8fr) minmax(200px,1fr);
  border:1px solid var(--line); background:var(--card); border-radius:12px; overflow:hidden;
}
.project-overview .release-art { aspect-ratio:16/9; min-height:0; }
.project-actions { display:grid; align-content:center; gap:10px; padding:clamp(16px,3vw,32px); }
.project-actions p { margin:2px 0 0; color:var(--muted); font-size:.88rem; }
.project-actions [aria-disabled=true] { opacity:.55; cursor:default; }
.art-controls { position:absolute; inset:auto 10px 10px; display:flex; flex-wrap:wrap; gap:6px; justify-content:flex-end; }
.art-controls button {
  min-height:36px; border-radius:30px; padding:6px 12px; font-size:.82rem;
  background:var(--card); border:1px solid #d5ddd0; color:var(--ink);
}
#list-game::before { content:"+"; }
#list-game[aria-pressed=true] { background:var(--lime); border-color:var(--lime); }
#list-game[aria-pressed=true]::before { content:"✓"; }
@media(max-width:650px) { .project-overview { grid-template-columns:1fr; } }
.release-error {
  margin:12px 0 0;
}

.facts {
  display:grid;
  grid-template-columns:1fr .7fr 1.7fr;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:9px;
  margin:13px 0;
}

.facts>div {
  min-width:0;
  padding:15px 17px;
}

.facts>div+div {
  border-left:1px solid var(--line);
}

.facts span,.facts strong,.facts a {
  display:block;
}

.facts strong,.facts a {
  font-weight:580;
  font-size:.85rem;
  margin-top:5px;
  overflow-wrap:anywhere;
}

.facts a {
  color:#305d3f;
}

.facts span,.metric-label {
  letter-spacing:.025em;
  text-transform:none;
}

.billing-grid {
  display:grid;
  gap:16px;
  grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);
  align-items:start;
  margin-top:26px;
}

.panel,details,.empty {
  border:1px solid var(--line);
  background:var(--card);
  border-radius:9px;
}

.panel,.empty {
  padding:clamp(19px,2.7vw,30px);
}

.panel h2,.empty h2 {
  margin:7px 0 9px;
}

.panel h2 {
  font-size:clamp(22px,2.4vw,29px);
}

.panel p {
  font-size:.89rem;
}

.panel label,dialog label {
  display:block;
  font-size:.84rem;
  font-weight:620;
  margin:18px 0 6px;
}

.panel label span {
  color:var(--muted);
  font-size:.76rem;
  display:inline-block;
  font-weight:450;
  margin-left:3px;
}

.inline-input {
  gap:8px;
}

.inline-input input {
  min-width:0;
  flex:1;
}

.inline-input button {
  white-space:nowrap;
}

input,select {
  color:var(--ink);
  border:1px solid #c5d0c4;
  background:#fff;
  border-radius:6px;
  min-height:40px;
  padding:8px 11px;
  width:100%;
}

input::placeholder {
  color:#748277;
}

.snippet {
  display:flex;
  align-items:flex-start;
  gap:4px;
  background:#f0f3eb;
  border:1px solid #d8e0d5;
  padding:9px 8px 9px 12px;
  border-radius:6px;
}

.snippet code {
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  flex:1;
  font-family:"IBM Plex Mono",ui-monospace,monospace;
  font-size:.78rem;
  line-height:1.5;
  align-self:center;
}

code {
  font-size:.92em;
}

.text-button {
  padding:3px 7px;
  min-height:30px;
  color:var(--accent);
  font-size:.78rem;
}

.tokens {
  padding:0;
  margin:13px 0 0;
  list-style:none;
}

.tokens li {
  border-top:1px solid var(--line);
  display:flex;
  gap:9px;
  justify-content:space-between;
  align-items:center;
  padding:7px 0;
  overflow-wrap:anywhere;
  font-size:.88rem;
}

.token-result {
  background:#eef6e2;
  padding:0 10px 10px;
  margin-top:12px;
  border:1px solid #cbdeb7;
  border-radius:6px;
  display:flow-root;
}

.token-result label {
  margin-top:10px;
}

.limit-footer {
  justify-content:space-between;
  gap:10px;
  margin-top:14px;
}

.limit-footer span,.tariff {
  font-size:.76rem!important;
  color:var(--muted);
}

.tariff {
  margin-top:12px;
}

.empty p {
  margin-bottom:18px;
}

details {
  padding:13px 17px;
}

summary {
  cursor:pointer;
  font-size:.86rem;
  font-weight:640;
}

details p {
  font-size:.87rem;
  margin:11px 0;
}

dialog {
  width:min(420px,calc(100% - 32px));
  border:1px solid var(--line);
  border-radius:12px;
  padding:25px;
  background:var(--card);
  color:var(--ink);
}

dialog::backdrop {
  background:#0e221b8f;
}

.dialog-heading,.dialog-actions {
  justify-content:space-between;
  gap:12px;
}

.dialog-heading button {
  background:transparent;
  font-size:21px;
  min-height:36px;
  color:var(--muted);
}

.dialog-actions {
  margin-top:20px;
  justify-content:flex-end;
}

.delete-link {
  margin-top:16px;
  padding-inline:0;
  background:transparent;
  color:var(--error);
}

.destructive { background:var(--error); color:white; }
#delete-title { overflow-wrap:anywhere; }
#delete-description { line-height:1.55; }

.inline-error {
  margin:12px 0 0;
  font-size:.84rem;
}

@media(max-width:710px) {
  .billing-grid {
    grid-template-columns:1fr;
  }
  .account #email {
    display:none;
  }
  .facts {
    grid-template-columns:1fr 1fr;
  }
  .facts>div:last-child {
    grid-column:1/-1;
    border-left:0;
    border-top:1px solid var(--line);
  }
  .release-card { grid-template-columns:1fr; }
  .release-art { grid-row:1; min-height:0; aspect-ratio:2.3; }
  .release-info { padding:20px; }
  .topbar {
    height:60px;
  }
  .account,.mast {
    gap:9px;
  }

  .product {
    padding-left:10px;
  }
}

@media(max-width:410px) {
  .workspace-heading .primary {
    padding-inline:10px;
  }
  .brand {
    font-size:22px;
  }
  .topbar {
    padding:0 13px;
  }
  .sections a {
    font-size:.8rem;
  }
  .product {
    display:none;
  }
  .inline-input {
    flex-wrap:wrap;
  }
  .inline-input input {
    min-width:110px;
  }
  .facts>div {
    padding:11px;
  }
}

@media(prefers-reduced-motion:reduce) {
  :root {
    scroll-behavior:auto;
  }
}

.pay-note {
  font-size:.82rem;
  color:var(--muted);
  margin:8px 0 0;
}

.workspace-heading { margin-bottom:22px; }
.overview-title { margin-bottom:16px; }
.overview-title label { color:var(--muted); font-weight:600; }
.connection-panel { max-width:760px; }
.connect-note { color:var(--muted); margin-top:12px; }
.connection-panel details { margin-top:22px; }
.connection-panel #tokens:empty,.connection-panel #connections:empty { display:none; }
.copy-fallback { display:block; margin:12px 0 0; white-space:pre-wrap; overflow-wrap:anywhere; font-size:.78rem; line-height:1.5; color:var(--ink); user-select:all; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.wallet { display:grid; grid-template-columns:1.3fr 1fr 1fr; background:var(--pine); color:#f5faef; border-radius:12px; padding:22px 10px; }
.wallet>div { padding:5px clamp(12px,3vw,32px); }
.wallet>div+div { border-left:1px solid #597366; }
.wallet span { display:block; color:#d1e2d3; font-size:.83rem; }
.wallet strong { display:block; font-size:clamp(24px,3.5vw,40px); letter-spacing:-.045em; font-variant-numeric:tabular-nums; }
.wallet>div:first-child strong { color:var(--lime); }
.billing-grid h3 { font-size:.95rem; margin:22px 0 8px; }
.pay-options { display:grid; gap:7px; }
.pay-options button { position:relative; align-items:flex-start; flex-direction:column; gap:2px; padding:12px 34px 12px 14px; text-align:left; background:var(--card); }
.pay-options button::after { content:""; position:absolute; right:16px; top:calc(50% - 3px); width:7px; height:7px; border:solid var(--accent); border-width:1.5px 1.5px 0 0; transform:rotate(45deg); }
.pay-options button:hover { background:#eef3e9; }
#plan-status>* { display:block; margin-top:3px; }
#plan-status strong { color:var(--ink); font-size:1.02rem; }
.pay-options strong { font-size:1.02rem; }
.pay-options small { color:var(--muted); font-size:.84rem; font-weight:450; }
#manage-billing { margin-top:15px; }
.checkout-status { padding:12px 16px; margin-bottom:14px; background:#e5f0db; border-radius:7px; color:var(--ink); }
.history-toolbar,.history-toolbar>div { display:flex; align-items:center; gap:10px; }
.history-toolbar { justify-content:flex-start; flex-wrap:wrap; margin-bottom:16px; }
.history-toolbar select { width:auto; max-width:min(220px,56vw); }
.history-card { background:var(--card); border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.history-card table { border-collapse:collapse; width:100%; font-size:.88rem; }
.history-card th,.history-card td { padding:14px 16px; text-align:left; vertical-align:middle; }
.history-card th { background:#eaf0e6; color:var(--muted); font-weight:600; font-size:.78rem; }
.history-card td { border-top:1px solid var(--line); overflow-wrap:anywhere; }
.history-card td:first-child { width:64%; }
.history-card td:last-child,.history-card th:last-child { text-align:right; font-variant-numeric:tabular-nums; }
.history-card small,.history-card time { display:block; margin-top:4px; font-size:.76rem; color:var(--muted); }
.history-card .request-prompt { margin-top:4px; white-space:pre-wrap; }
.history-card details { padding:0; border:0; margin-top:5px; }
.history-card summary { font-weight:500; color:var(--muted); }
.status { display:inline-block; border-radius:5px; background:#eef1e9; padding:3px 8px; font-size:.78rem; }
.status[data-tone=success] { background:transparent; color:#365d3c; padding-inline:0; }
.status[data-tone=error] { background:#fbebe4; color:#883b31; }
.status[data-tone=pending] { background:#f7edce; color:#6d5419; }
.history-message { padding:20px; }
#history-more { margin:14px 16px; }
@media(max-width:600px) {
  .wallet { grid-template-columns:1fr 1fr; }
  .wallet>div:first-child { grid-column:1/-1; padding-bottom:14px; }
  .wallet>div:nth-child(2) { border-left:0; }
  .history-card table,.history-card tbody { display:block; }
  .history-card thead { position:absolute; clip-path:inset(50%); width:1px; height:1px; overflow:hidden; }
  .history-card tr { display:grid; grid-template-columns:minmax(0,1fr) auto; padding:12px; gap:4px 10px; }
  .history-card tbody tr+tr { border-top:1px solid var(--line); }
  .history-card td,.history-card td:first-child { padding:0; width:auto; border:0; }
  .history-card td:first-child { grid-area:1/1; }
  .history-card td:nth-child(2) { grid-area:2/1; }
  .history-card td:last-child { grid-area:1/2/3/3; max-width:90px; }
  .request-identity { gap:10px; }
  .history-card .asset-thumb { width:44px; height:44px; }
}

.request-identity { display:flex; align-items:center; gap:14px; min-width:0; }
.request-info { min-width:0; }
.request-info>strong,.request-info>span { display:block; }
.request-info>strong,.history-card td:last-child>strong { font-size:.98rem; }
.request-info>span { font-size:.85rem; color:var(--muted); margin-top:2px; }
.request-info time { font-size:.8rem; }
.asset-thumb {
  position:relative; flex:none; display:grid; place-items:center; width:54px; height:54px;
  padding:0; overflow:hidden; border:1px solid #ced8c9; border-radius:7px;
  color:#4e6557; background:#e9ede4; font-size:.79rem; font-weight:650;
}
.asset-thumb img { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; background:#e9ede4; }
.sound-thumb { background:#dfedcf; color:var(--pine); }
.sound-thumb::after { content:""; border:solid transparent; border-width:8px 0 8px 13px; border-left-color:currentColor; margin-left:3px; }
.sound-thumb[data-state=pause]::after { border:solid currentColor; border-width:0 4px; width:6px; height:14px; margin:0; }
.variant-select { display:block; width:auto; min-height:32px; margin-top:6px; padding:3px 6px; font-size:.82rem; }
#preview-dialog { width:min(680px,calc(100% - 32px)); }
#preview-dialog h2 { font-size:1.35rem; overflow-wrap:anywhere; }
#preview-image { display:block; width:100%; max-height:65vh; object-fit:contain; margin-top:16px; background:#e9ede4; border-radius:6px; }

.discover-nav { padding:8px 0 8px 15px; border-left:1px solid var(--line); font-weight:650; color:var(--pine); text-decoration:none; }
.discover-nav:hover { text-decoration:underline; }
@media(max-width:550px) {
  .mast .discover-nav { font-size:.85rem; padding-left:9px; }
}

/* Two ways to start, and the starting points of the browser builder. */
.choices { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:14px; }
.choice { display:flex; flex-direction:column; align-items:flex-start; gap:9px; padding:18px; border:1px solid var(--line); border-radius:8px; background:#fff; }
.choice h3 { margin:0; font-size:1.06rem; letter-spacing:-.02em; }
.choice p { margin:0 0 6px; flex:1; font-size:.89rem; }
.choice .text-button { padding-inline:0; }
#build-start h2 { margin-bottom:6px; }
#build-start>p { margin-bottom:18px; }

/* Build: the conversation on the left, the playable game on the right. */
body.wide main { width:min(1680px,100%); }
body.wide .workspace-heading { margin-bottom:12px; }
body.wide .workspace-heading h1 { font-size:clamp(28px,3vw,36px); }
.build { display:grid; grid-template-columns:minmax(320px,2fr) minmax(0,3fr); gap:16px; height:max(460px,calc(100vh - 262px)); }
.chat,.stage { display:flex; flex-direction:column; min-height:0; min-width:0; border:1px solid var(--line); border-radius:9px; background:var(--card); overflow:hidden; }
#chat-log { flex:1; min-height:0; overflow-y:auto; margin:0; padding:16px; list-style:none; display:flex; flex-direction:column; gap:10px; overscroll-behavior:contain; }
#chat-log>li { max-width:92%; overflow-wrap:anywhere; font-size:.92rem; line-height:1.5; }
.msg { padding:9px 13px; border-radius:11px; white-space:pre-wrap; }
.msg.user { align-self:flex-end; background:var(--pine); color:#f1f6e7; border-bottom-right-radius:3px; }
.msg.assistant { align-self:flex-start; background:#eef1e8; border-bottom-left-radius:3px; }
.msg.problem { align-self:flex-start; background:#fcf0eb; border:1px solid #e5beb3; color:var(--error); }
.activity ul { margin:0; padding:0 0 0 12px; list-style:none; border-left:2px solid var(--line); color:var(--muted); font-size:.8rem; line-height:1.65; }
#chat-log>.meta { align-self:center; color:var(--muted); font-size:.76rem; }
#chat-log>.card { align-self:flex-start; display:grid; gap:8px; padding:13px; border:1px solid var(--line); border-radius:9px; background:#fff; }
.card p { margin:0; font-size:.86rem; }
.card small { color:var(--muted); font-size:.76rem; }
.card-actions { display:flex; flex-wrap:wrap; gap:8px; }
.card.asset img { display:block; max-width:min(100%,220px); max-height:220px; border-radius:6px; background:repeating-conic-gradient(#e9ede3 0 25%,#f8faf4 0 50%) 0 0/16px 16px; }
.card.asset audio { width:min(100%,260px); }
#chat-form { border-top:1px solid var(--line); padding:12px; display:grid; gap:8px; background:#fff; }
#chat-input { font:inherit; color:var(--ink); width:100%; min-height:62px; max-height:38vh; resize:vertical; border:1px solid #c5d0c4; border-radius:7px; padding:9px 11px; background:#fff; line-height:1.45; }
#chat-input:focus-visible { outline:3px solid #538cda; outline-offset:2px; }
#chat-input::placeholder { color:#748277; }
.chat-actions { display:flex; align-items:center; gap:8px; }
.chat-actions small { flex:1; color:var(--muted); font-size:.76rem; line-height:1.35; }
.stage-bar { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; padding:8px 10px; border-bottom:1px solid var(--line); background:#fff; }
.stage-bar select { flex:1 1 150px; width:auto; min-width:0; max-width:230px; min-height:34px; padding:4px 8px; font-size:.82rem; margin-left:auto; }
.stage-bar .primary { min-height:34px; padding:6px 13px; }
.stage-bar select[hidden]+.primary { margin-left:auto; }
#preview-frame { flex:1; min-height:0; width:100%; border:0; background:#101a16; }
.stage-note { margin:0; padding:10px 14px; border-top:1px solid var(--line); font-size:.84rem; color:var(--ink); background:#fff; overflow-wrap:anywhere; }
#preview-missing { flex:1; border-top:0; background:transparent; color:var(--muted); }
#preview-problem { background:#fcf0eb; color:var(--error); }
.stage-note a { color:var(--accent); font-weight:600; }

@media(max-width:900px) {
  .build { grid-template-columns:1fr; height:auto; }
  .chat { height:min(560px,72vh); }
  .stage { height:min(620px,78vh); }
}
@media(max-width:480px) {
  .sections { gap:13px; overflow-x:auto; scrollbar-width:none; }
}

/* The studio opens on the game shelf. Each tile is one link, including its artwork. */
.topbar:has(#top-credit:not([hidden])) { position:sticky; top:0; z-index:5; }
#top-credit { display:inline-flex; align-items:center; gap:7px; border-radius:7px; background:#e7f2dc; color:var(--pine); text-decoration:none; padding:7px 10px; white-space:nowrap; }
#top-credit strong { font-variant-numeric:tabular-nums; }
.project-gallery { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,268px),1fr)); gap:22px; }
.project-tile { min-width:0; display:block; overflow:hidden; background:var(--card); border:1px solid var(--line); border-radius:12px; text-decoration:none; }
.project-tile:hover { border-color:#819886; box-shadow:0 3px 12px #19392e15; }
.tile-art { display:block; position:relative; aspect-ratio:3/2; background:var(--pine); overflow:hidden; }
.tile-art img,.tile-art canvas { width:100%; height:100%; display:block; object-fit:cover; }
.tile-art img { position:absolute; inset:0; }
.tile-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px; }
.tile-footer h2 { font-size:1.13rem; margin:0; overflow-wrap:anywhere; }
.tile-footer .status { flex:none; }
.back-link { display:inline-block; color:var(--muted); font-size:.88rem; margin-bottom:8px; }
.billing-history { margin-top:36px; }
.billing-history h2 { margin:0; }
.billing-history .history-toolbar { justify-content:space-between; }
#project-dialog select { margin:0 0 12px; }
@media(max-width:600px) {
  .topbar:has(#top-credit:not([hidden])) { height:auto; min-height:60px; padding-block:8px; flex-wrap:wrap; gap:6px; }
  #top-credit { flex-direction:column; align-items:flex-start; line-height:1.1; gap:2px; padding:6px 8px; }
  #top-credit span { font-size:.68rem; }
}


.agent-panel,.account-view { max-width:680px; }
.agent-panel select { max-width:340px; }
.agent-panel h2 { margin:0 0 20px; }
#agent-setup { margin-top:16px; }
#agent-instructions { margin:0 0 12px; }
#claude-help { margin-top:16px; }
#agent-prompt { width:100%; }
.account-view { display:grid; gap:16px; }
.account-facts { margin:0 0 20px; display:grid; gap:12px; }
.account-facts>div { display:grid; grid-template-columns: minmax(6em,1fr) 2fr; gap:8px; }
.account-facts dt,.receipt-detail dt { color:var(--muted); }
.account-facts dd,.receipt-detail dd { margin:0; overflow-wrap:anywhere; }
#profile-form { border-top:1px solid var(--line); padding-top:18px; }
#profile-form input { max-width:360px; }
#profile-form p { margin:5px 0 14px; font-size:.86rem; }
#account-access summary { font-weight:650; }
#manage-billing { justify-self:start; }
.wallet.account-wallet { grid-template-columns:1fr 1fr; }
.wallet.account-wallet>div:first-child { grid-column:auto; padding-bottom:5px; }
.wallet.account-wallet>div+div { border-left:1px solid #597366; }
.top-up { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:16px 0 28px; }
.top-up h2 { margin:0; }
.top-up span { font-size:.87rem; color:var(--muted); white-space:nowrap; }
.history-card .request-row { margin:0; border-radius:0; }
.request-row + .request-row { border-top:1px solid var(--line); }
.history-card .request-row summary { display:flex; align-items:center; gap:12px; padding:14px 16px; color:var(--ink); }
.request-row summary::-webkit-details-marker { display:none; }
.request-row summary::before { content:""; width:6px; height:6px; border:solid currentColor; border-width:0 1.5px 1.5px 0; transform:rotate(-45deg); flex:none; }
.request-row[open] summary::before { transform:rotate(45deg); }
.request-row summary span { min-width:0; flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.request-row summary strong { font-variant-numeric:tabular-nums; }
.receipt-detail { padding:0 18px 16px 36px; font-size:.88rem; overflow-wrap:anywhere; }
.receipt-detail dl { display:grid; grid-template-columns:max-content 1fr; gap:4px 16px; margin:0; }
.receipt-detail p { white-space:pre-wrap; }
