:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --surface-3: #eef1f5;
  --text: #15171a;
  --muted: #68707b;
  --subtle: #8a929d;
  --border: #dfe4ea;
  --border-strong: #cbd2dc;
  --accent: #ef3127;
  --accent-hover: #c92922;
  --success: #16a05d;
  --warning: #d78a00;
  --blue: #1769ff;
  --shadow: 0 14px 36px rgba(18, 24, 34, .07);
  --shadow-strong: 0 24px 70px rgba(18, 24, 34, .12);
  --radius: 8px;
  --radius-large: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d10;
  --surface: #12161b;
  --surface-2: #171c22;
  --surface-3: #202731;
  --text: #f4f6f8;
  --muted: #a0a8b2;
  --subtle: #7e8794;
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .15);
  --accent: #ff453a;
  --accent-hover: #df352e;
  --success: #2bc77f;
  --warning: #f2af3f;
  --blue: #78a8ff;
  --shadow: 0 14px 36px rgba(0, 0, 0, .22);
  --shadow-strong: 0 26px 74px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@keyframes dotPulse {
  0%, 70%, 100% { opacity: .35; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-2px); }
}
@keyframes pipeDash {
  to { stroke-dashoffset: -42; }
}
@keyframes orbitSpin {
  to { rotate: 360deg; }
}
@keyframes statusBlink {
  0%, 100% { opacity: .45; }
  50% { opacity: 1; }
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, a, input, textarea { outline-color: color-mix(in srgb, var(--accent) 65%, transparent); }

.topbar {
  height: 58px;
  display: grid;
  grid-template-columns: 220px minmax(260px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 0 max(24px, calc((100vw - 1420px) / 2));
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: 22px;
  font-weight: 880;
  letter-spacing: 0;
}
.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
}
.topbar nav {
  display: flex;
  justify-content: center;
  gap: 34px;
  min-width: 0;
  font-size: 14px;
  font-weight: 760;
}
.topbar nav a {
  position: relative;
  padding: 20px 0 18px;
  color: var(--text);
  white-space: nowrap;
}
.topbar nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
}
.account {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
}
.top-search {
  width: min(260px, 22vw);
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius);
  padding: 0 17px;
  background: var(--accent);
  color: #fff;
  font-weight: 820;
  cursor: pointer;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 18%, transparent);
}
.button:hover { background: var(--accent-hover); }
.button.small { min-height: 34px; padding: 0 13px; font-size: 13px; }
.ghost, .chip, .theme-toggle {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text);
  font-weight: 780;
  cursor: pointer;
}
.ghost:hover, .chip:hover, .theme-toggle:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.theme-toggle { font-size: 12px; }
.login-link { white-space: nowrap; }
.full { width: 100%; }

.discover {
  max-width: 1420px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}
.product-hero {
  min-height: clamp(520px, 62vh, 650px);
  display: grid;
  grid-template-columns: minmax(340px, .34fr) minmax(0, .66fr);
  gap: 36px;
  align-items: center;
}
.hero-intro h1 {
  margin: 0 0 18px;
  max-width: 560px;
  font-size: clamp(44px, 5vw, 72px);
  line-height: .96;
  letter-spacing: 0;
}
.hero-intro p {
  margin: 0;
  max-width: 500px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}
.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.hero-proof span,
.publish-row span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 72%, var(--surface-2));
  font-size: 12px;
  font-weight: 760;
}

.workflow-diagram {
  min-height: 500px;
  position: relative;
  display: grid;
  grid-template-columns: 216px minmax(220px, 1fr) 278px;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 18px;
  overflow: hidden;
  padding: 30px 28px 78px;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background:
    radial-gradient(circle at 50% 46%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 34%),
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 5%, transparent) 50%, transparent),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, var(--surface-2)), var(--surface));
  box-shadow: var(--shadow-strong);
  isolation: isolate;
}
.diagram-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  color: color-mix(in srgb, var(--border) 76%, transparent);
  pointer-events: none;
}
.svg-grid {
  opacity: .24;
  mask-image: radial-gradient(circle at 50% 48%, black 0, transparent 80%);
}
.svg-crosshair path {
  stroke: color-mix(in srgb, var(--accent) 24%, transparent);
  stroke-width: 1;
  stroke-dasharray: 4 8;
  opacity: .45;
}
.pipe-base,
.pipe-active,
.orbit,
.orbit-notch,
.svg-crosshair path {
  fill: none;
  vector-effect: non-scaling-stroke;
}
.flow-card,
.bake-engine,
.engine-modules {
  position: relative;
  z-index: 1;
}
.flow-card {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 24px 58px rgba(18, 24, 34, .09);
  backdrop-filter: blur(18px);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.creator-flow-card {
  grid-column: 1;
  padding: 16px;
  min-height: 308px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.output-flow-card {
  grid-column: 3;
  overflow: hidden;
  min-height: 334px;
  align-self: center;
}
.workflow-diagram[data-flow="chat"] [data-stage-target~="chat"],
.workflow-diagram[data-flow="assets"] [data-stage-target~="assets"],
.workflow-diagram[data-flow="logic"] [data-stage-target~="logic"],
.workflow-diagram[data-flow="publish"] [data-stage-target~="publish"] {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
  box-shadow: 0 30px 72px color-mix(in srgb, var(--accent) 11%, rgba(18, 24, 34, .12));
}
.stage-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.stage-title b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
}
.prompt-tile {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  color: var(--text);
  font-size: 15px;
  font-weight: 720;
  line-height: 1.28;
}
.prompt-tile em {
  align-self: flex-end;
  margin-top: 12px;
  color: var(--subtle);
  font-size: 10px;
  font-style: normal;
  font-weight: 650;
}
.codex-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--text);
  font-size: 13px;
  font-weight: 820;
}
.codex-row span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
}
.codex-row i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.creator-flow-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.typing-dots {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}
.typing-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--muted) 70%, var(--surface));
  animation: dotPulse 1.35s infinite;
}
.typing-dots i:nth-child(2) { animation-delay: .16s; }
.typing-dots i:nth-child(3) { animation-delay: .32s; }
.bake-engine {
  grid-column: 2;
  height: 300px;
  display: grid;
  place-items: center;
  justify-self: center;
  align-self: center;
  z-index: 2;
  transition: transform .18s ease;
}
.bake-engine .stage-title {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}
.bake-core {
  width: 158px;
  height: 158px;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 26%, #ff786d, var(--accent) 46%, #b61712);
  color: #fff;
  box-shadow:
    0 0 0 12px color-mix(in srgb, var(--accent) 9%, transparent),
    0 22px 60px color-mix(in srgb, var(--accent) 30%, transparent);
}
.bake-core span { font-size: 19px; line-height: 1; }
.bake-core strong { display: block; margin-top: -6px; font-size: 27px; line-height: 1; }
.bake-core em { margin-top: -8px; font-size: 11px; line-height: 1.35; font-style: normal; opacity: .9; }
.engine-status {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
  border-radius: 999px;
  padding: 7px 10px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--accent);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 8%, transparent);
  font-size: 11px;
  font-weight: 840;
  white-space: nowrap;
}
.engine-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: statusBlink 1.4s ease-in-out infinite;
}
.pipe-base {
  stroke: color-mix(in srgb, var(--accent) 18%, var(--border));
  stroke-width: 1.25;
}
.pipe-active {
  opacity: .28;
  stroke: url(#pipeFade);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-dasharray: 12 18;
  animation: pipeDash 1.6s linear infinite;
}
.port {
  fill: var(--surface);
  stroke: color-mix(in srgb, var(--accent) 70%, var(--border));
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.orbit {
  transform-box: fill-box;
  transform-origin: center;
  stroke: color-mix(in srgb, var(--accent) 25%, transparent);
  stroke-width: 1.3;
  stroke-dasharray: 3 8;
}
.orbit-a { animation: orbitSpin 28s linear infinite; }
.orbit-b { animation: orbitSpin 36s linear infinite reverse; opacity: .85; }
.orbit-notch {
  stroke: color-mix(in srgb, var(--accent) 58%, transparent);
  stroke-width: 1.5;
  stroke-linecap: round;
}
.orbit-node {
  fill: var(--accent);
  opacity: .72;
}
.workflow-diagram[data-flow="chat"] .pipe-group-chat .pipe-active,
.workflow-diagram[data-flow="assets"] .pipe-group-assets .pipe-active,
.workflow-diagram[data-flow="logic"] .pipe-group-logic .pipe-active,
.workflow-diagram[data-flow="publish"] .pipe-group-publish .pipe-active,
.workflow-diagram[data-flow="publish"] .pipe-group-web .pipe-active {
  opacity: 1;
  stroke-width: 3;
}
.workflow-diagram[data-flow="chat"] .pipe-group-chat .port,
.workflow-diagram[data-flow="assets"] .pipe-group-assets .port,
.workflow-diagram[data-flow="logic"] .pipe-group-logic .port,
.workflow-diagram[data-flow="publish"] .pipe-group-publish .port,
.workflow-diagram[data-flow="publish"] .pipe-group-web .port {
  fill: var(--accent);
  stroke: var(--surface);
}
.hero-game-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 72% 26%, rgba(255, 255, 255, .16), transparent 24%),
    linear-gradient(180deg, #13213a, #07101e 72%);
}
.hero-game-preview canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.preview-native-overlay {
  position: absolute;
  inset: 9px 9px auto;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #fff;
  pointer-events: none;
}
.preview-native-overlay > span,
.preview-runtime-note {
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(7, 12, 22, .58);
  padding: 5px 7px;
  font-size: 9px;
  font-weight: 820;
  backdrop-filter: blur(12px);
}
.preview-controls {
  display: flex;
  gap: 4px;
  pointer-events: auto;
}
.preview-controls button {
  min-height: 24px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  padding: 0 7px;
  background: rgba(7, 12, 22, .5);
  color: rgba(255, 255, 255, .78);
  font-size: 9px;
  font-weight: 820;
  cursor: pointer;
}
.preview-controls button.selected {
  border-color: rgba(255, 255, 255, .32);
  background: #fff;
  color: #11161d;
}
.preview-runtime-note {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  color: rgba(255, 255, 255, .86);
}
.output-flow-card .stage-title {
  padding: 14px 14px 0;
  margin-bottom: 10px;
}
.output-copy {
  padding: 14px;
}
.output-copy strong {
  display: block;
  color: var(--text);
  font-size: 19px;
  line-height: 1.15;
}
.output-copy span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}
.output-copy .button { margin-top: 14px; }
.engine-modules {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 3;
}
.module-chip {
  min-width: 90px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  column-gap: 8px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(18, 24, 34, .06);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.module-chip:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 24%, var(--border));
}
.module-chip span {
  grid-row: 1 / span 2;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
}
.module-chip strong {
  overflow: hidden;
  font-size: 11px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.module-chip em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}
.module-chip::after {
  content: "";
  grid-column: 2;
  width: 5px;
  height: 5px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--success);
}
.module-chip.selected {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 36%, var(--border));
  box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 13%, transparent);
}
.module-chip.selected span {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}

.shelf-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin: 16px 0 14px;
}
.shelf-head h2 { margin: 0; font-size: 20px; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 34px; padding: 0 14px; font-size: 12px; }
.chip.active {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--accent);
}
.game-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}
.game-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.game-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-strong);
}
.poster-link {
  position: relative;
  display: block;
  background: var(--surface-2);
}
.poster {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  object-fit: cover;
}
.bookmark {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .14);
}
.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .22);
  color: #fff;
  font-size: 34px;
  opacity: 0;
  transition: opacity .16s ease;
}
.game-card:hover .play-overlay { opacity: 1; }
.game-copy { padding: 12px 12px 13px; }
.tag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.tag-row span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.tag-row em {
  color: var(--subtle);
  font-size: 11px;
  font-style: normal;
}
.game-copy h2 {
  margin: 0 0 6px;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}
.meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.meta a {
  flex: 0 0 auto;
  color: var(--accent);
  font-weight: 820;
}

.studio {
  height: calc(100vh - 58px);
  min-height: 760px;
  display: grid;
  grid-template-columns: 218px 374px minmax(0, 1fr);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--surface-2) 78%, var(--surface)) 0, var(--surface) 38%, var(--surface-2) 100%);
}
.studio-console {
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.project-rail {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 14px;
  border-right: 1px solid var(--border);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 92%, var(--surface)), var(--surface-2)),
    var(--surface-2);
  padding: 18px 12px;
}
.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 860;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.rail-head strong {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}
.project-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 6px;
}
.project-item {
  width: 100%;
  min-height: 56px;
  display: grid;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}
.project-item span,
.project-item em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-item span {
  color: inherit;
  font-size: 13px;
  font-style: normal;
  font-weight: 820;
}
.project-item em {
  color: var(--subtle);
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
  text-transform: uppercase;
}
.project-item.selected, .project-item:hover {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 20px rgba(18, 24, 34, .045);
}
.rail-pipeline {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  padding: 12px;
}
.rail-pipeline div {
  display: grid;
  grid-template-columns: 11px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}
.rail-pipeline i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 14%, transparent);
}
.chat-pane {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  border-right: 1px solid var(--border);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 98%, var(--surface-2)), var(--surface));
}
.assistant-head {
  min-height: 86px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 18px;
}
.bot-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 920;
  box-shadow: 0 12px 26px color-mix(in srgb, var(--accent) 22%, transparent);
}
.assistant-head h1 { margin: 0 0 4px; font-size: 17px; line-height: 1.1; }
.assistant-head span { color: var(--muted); font-size: 12px; line-height: 1.35; }
.live-chip {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--success) 24%, var(--border));
  border-radius: 999px;
  padding: 0 9px;
  background: color-mix(in srgb, var(--success) 8%, var(--surface));
  color: var(--success) !important;
  font-size: 11px !important;
  font-weight: 860;
}
.messages {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}
.message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: 10px;
  align-items: start;
}
.message::before {
  content: "";
  grid-row: span 2;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), var(--surface));
}
.message.user::before { background: url("/static/covers/avatar-showcase.png") center / cover; }
.role {
  margin-bottom: 5px;
  color: var(--text);
  font-size: 12px;
  font-weight: 860;
}
.message-content {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  padding: 11px 12px;
  font-size: 13px;
  line-height: 1.48;
  box-shadow: 0 8px 20px rgba(18, 24, 34, .035);
}
.message.user .message-content {
  border-color: color-mix(in srgb, var(--accent) 20%, var(--border));
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  color: var(--text);
}
.message-content strong { color: var(--text); font-weight: 840; }
.empty {
  width: min(260px, 100%);
  margin: auto;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}
.prompt-presets {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-top: 1px solid var(--border);
  padding: 10px 12px 0;
}
.prompt-presets button {
  min-height: 31px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 11px;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}
.prompt-presets button:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  color: var(--text);
}
.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 10px;
  padding: 10px 12px 14px;
}
.composer textarea {
  min-width: 0;
  resize: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 11px 12px;
  line-height: 1.35;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
}
.composer textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--border));
}
.composer .button {
  min-width: 44px;
  padding: 0;
  font-size: 0;
  position: relative;
}
.composer .button::after {
  content: ">";
  font-size: 22px;
  line-height: 1;
  transform: translateX(1px);
}
.viewport-pane {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr) 316px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 82%, var(--surface)), var(--surface-2));
}
.viewport-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  padding: 0 20px;
  backdrop-filter: blur(14px);
}
.viewport-head strong {
  display: block;
  max-width: 48vw;
  overflow: hidden;
  font-size: 18px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.viewport-head span { color: var(--muted); font-size: 12px; }
.viewport-actions { display: flex; align-items: center; gap: 10px; }
.preview-stage {
  position: relative;
  min-height: 0;
  margin: 16px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-large);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .04), transparent),
    #070910;
  box-shadow: var(--shadow-strong);
}
.preview-toolbar {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #f7f8fb;
  pointer-events: none;
}
.preview-toolbar span,
.preview-toolbar em {
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(7, 9, 16, .62);
  padding: 6px 10px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  backdrop-filter: blur(12px);
}
.preview-toolbar em { color: rgba(255, 255, 255, .68); }
.preview-stage iframe {
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #070910;
}
.empty-preview {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  color: #f7f8fb;
  text-align: center;
  background:
    radial-gradient(circle at 50% 40%, rgba(239, 49, 39, .22), transparent 28%),
    linear-gradient(180deg, rgba(7, 9, 16, .62), rgba(7, 9, 16, .86));
}
.empty-preview strong { font-size: 18px; }
.empty-preview span {
  max-width: 360px;
  color: rgba(255, 255, 255, .66);
  font-size: 13px;
  line-height: 1.45;
}
.lower-panels {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 262px;
  gap: 14px;
  padding: 0 16px 16px;
}
.lower-panels > div,
.game-info {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(18, 24, 34, .045);
}
.build-console {
  display: grid;
  grid-template-rows: 42px 148px minmax(0, 1fr);
}
.tabs {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.tabs .selected { color: var(--text); position: relative; }
.tabs .selected::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -14px;
  height: 2px;
  background: var(--accent);
}
.bake-strip {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 42%),
    color-mix(in srgb, var(--surface) 96%, var(--surface-2));
}
.bake-strip-canvas {
  position: relative;
  width: 100%;
  min-width: 520px;
  height: 100%;
}
.bake-strip svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: color-mix(in srgb, var(--border) 72%, transparent);
  opacity: .78;
}
.bake-strip rect { opacity: .38; }
.bake-wire {
  fill: none;
  stroke: color-mix(in srgb, var(--accent) 68%, transparent);
  stroke-width: 1.6;
  stroke-dasharray: 7 7;
  animation: pipeDash 2.8s linear infinite;
}
.bake-port {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 2;
}
.bake-node,
.bake-core-mini {
  position: absolute;
  z-index: 1;
}
.bake-node {
  top: 43px;
  width: 132px;
  min-height: 62px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 2px 8px;
  align-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  padding: 9px 10px;
  box-shadow: 0 8px 22px rgba(18, 24, 34, .065);
}
.chat-node { left: 28px; }
.output-node { right: 28px; }
.bake-node b {
  grid-row: span 2;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
  font-size: 11px;
}
.bake-node strong { font-size: 12px; line-height: 1.1; }
.bake-node span { color: var(--muted); font-size: 11px; }
.bake-core-mini {
  left: 50%;
  top: 50%;
  width: 104px;
  height: 104px;
  display: grid;
  place-content: center;
  gap: 4px;
  border: 8px solid color-mix(in srgb, var(--accent) 8%, var(--surface));
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #ff756d, var(--accent));
  color: #fff;
  text-align: center;
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 24%, transparent),
    0 22px 42px color-mix(in srgb, var(--accent) 20%, transparent);
}
.bake-core-mini b { font-size: 21px; line-height: 1; }
.bake-core-mini span { font-size: 10px; font-weight: 720; line-height: 1.25; opacity: .88; }
.build-events {
  min-height: 0;
  overflow: auto;
  padding: 10px 16px;
}
.event-row {
  min-height: 30px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.event-row span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--subtle);
}
.event-row.running span { background: var(--blue); animation: statusBlink 1.4s ease-in-out infinite; }
.event-row.ok span { background: var(--success); }
.event-row.bad span { background: var(--accent); }
.game-info { padding: 14px; }
.game-info h2 { margin: 0 0 12px; font-size: 15px; }
.info-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.info-card img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius);
}
.info-card strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.info-card span { color: var(--muted); font-size: 12px; }
dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
dd { margin: 0; color: var(--text); }

.login-wrap {
  min-height: calc(100vh - 58px);
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, var(--bg), var(--surface-2));
}
.login-card {
  width: min(460px, 100%);
  display: grid;
  gap: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 26px;
  box-shadow: var(--shadow);
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.auth-tabs button {
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 820;
  cursor: pointer;
}
.auth-tabs button.selected {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 5px 14px rgba(0, 0, 0, .06);
}
.login-card h1 { margin: 0; font-size: 30px; }
.login-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.login-card label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
}
.login-card input {
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
}
.form-error { min-height: 20px; color: var(--accent); font-size: 13px; }
.error-page { padding: 40px; }

@media (max-width: 1280px) {
  .product-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 28px;
  }
  .hero-intro h1 { max-width: 760px; }
  .hero-intro p { max-width: 640px; }
  .workflow-diagram { min-height: 500px; }
  .game-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1320px) and (min-width: 1121px) {
  .studio {
    grid-template-columns: 82px 360px minmax(0, 1fr);
  }
  .project-rail {
    padding: 18px 8px;
  }
  .rail-head {
    justify-content: center;
    padding: 2px 0;
  }
  .rail-head span {
    display: none;
  }
  .rail-head strong {
    min-width: 28px;
    height: 28px;
  }
  .project-item {
    min-height: 50px;
    display: grid;
    place-items: center;
    padding: 0;
  }
  .project-item::before {
    content: attr(data-initial);
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
  }
  .project-item.selected::before,
  .project-item:hover::before {
    background: var(--accent);
    color: #fff;
  }
  .project-item span,
  .project-item em {
    display: none;
  }
  .project-rail .ghost.full {
    min-width: 0;
    padding: 0;
    font-size: 0;
  }
  .project-rail .ghost.full::before {
    content: "+";
    font-size: 22px;
    line-height: 1;
  }
  .rail-pipeline {
    justify-items: center;
    padding: 11px 0;
  }
  .rail-pipeline div {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0;
  }
  .rail-pipeline span {
    display: none;
  }
  .bake-strip-canvas { min-width: 100%; }
  .bake-node {
    top: 50px;
    width: 92px;
    min-height: 58px;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 2px 6px;
    padding: 8px;
  }
  .chat-node { left: 28px; }
  .output-node { right: 28px; }
  .bake-node b {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }
  .bake-node strong { font-size: 11px; }
  .bake-node span { font-size: 10px; }
  .bake-core-mini {
    width: 78px;
    height: 78px;
    border-width: 6px;
  }
  .bake-core-mini b { font-size: 18px; }
  .bake-core-mini span { font-size: 9px; }
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    gap: 14px;
  }
  .topbar nav { justify-content: start; gap: 22px; }
  .workflow-diagram {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    padding: 20px 20px 104px;
  }
  .flow-card,
  .bake-engine {
    width: min(520px, 100%);
    justify-self: center;
  }
  .creator-flow-card,
  .bake-engine,
  .output-flow-card {
    grid-column: 1;
  }
  .bake-engine { height: 280px; }
  .diagram-svg .pipe-group { opacity: .26; }
  .studio {
    height: auto;
    min-height: calc(100vh - 58px);
    grid-template-columns: 1fr;
    grid-template-rows: auto 560px minmax(820px, auto);
  }
  .project-rail { border-right: 0; border-bottom: 1px solid var(--border); }
  .chat-pane { border-right: 0; border-bottom: 1px solid var(--border); }
}

@media (max-width: 760px) {
  .topbar {
    height: 58px;
    grid-template-columns: 1fr auto;
    padding: 0 14px;
  }
  .topbar nav, .top-search, .account .login-link { display: none; }
  .account { gap: 8px; }
  .button, .ghost, .theme-toggle { min-height: 38px; padding: 0 12px; }
  .discover { padding: 24px 14px 44px; }
  .hero-intro h1 { font-size: 42px; }
  .hero-intro p { font-size: 15px; }
  .workflow-diagram {
    min-height: auto;
    gap: 16px;
    padding: 14px;
  }
  .diagram-svg {
    opacity: .5;
  }
  .diagram-svg .pipe-group,
  .diagram-svg .svg-crosshair {
    display: none;
  }
  .flow-card,
  .bake-engine {
    width: 100%;
  }
  .creator-flow-card {
    min-height: auto;
    padding: 14px;
  }
  .prompt-tile { min-height: 96px; font-size: 14px; }
  .bake-engine { height: 246px; }
  .bake-core { width: 142px; height: 142px; }
  .bake-core strong { font-size: 23px; }
  .engine-status { bottom: 18px; }
  .output-flow-card { min-height: auto; }
  .hero-game-preview { aspect-ratio: 16 / 10; }
  .engine-modules {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    grid-column: 1;
    transform: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .module-chip { min-width: 0; }
  .shelf-head { grid-template-columns: 1fr; gap: 12px; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .game-copy { padding: 10px; }
  .game-copy h2 { font-size: 14px; }
  .meta { align-items: flex-start; flex-direction: column; gap: 4px; }
  .lower-panels { grid-template-columns: 1fr; }
  .studio {
    grid-template-rows: auto minmax(560px, auto) minmax(880px, auto);
  }
  .project-rail {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 10px;
    padding: 16px 12px;
  }
  .project-list {
    grid-column: 1;
    overflow: hidden;
  }
  .project-item {
    min-height: 54px;
  }
  .project-rail .ghost.full {
    grid-column: 2;
    grid-row: 2;
    min-width: 122px;
  }
  .rail-pipeline {
    display: none;
  }
  .chat-pane {
    min-height: 560px;
  }
  .assistant-head {
    min-height: 96px;
    padding: 18px;
  }
  .viewport-pane {
    grid-template-rows: auto 360px auto;
  }
  .viewport-head {
    align-items: flex-start;
    padding: 16px 18px;
  }
  .viewport-head strong {
    max-width: 190px;
    white-space: normal;
  }
  .preview-stage {
    margin: 16px;
  }
  .build-console {
    grid-template-rows: 42px 164px minmax(84px, auto);
  }
  .bake-strip {
    min-height: 164px;
  }
  .bake-strip-canvas { min-width: 100%; }
  .bake-strip svg {
    opacity: .5;
  }
  .bake-node {
    top: 54px;
    width: 96px;
    min-height: 56px;
    grid-template-columns: 18px minmax(0, 1fr);
    padding: 8px;
  }
  .chat-node { left: 26px; }
  .output-node { right: 26px; }
  .bake-node b {
    width: 18px;
    height: 18px;
  }
  .bake-node span {
    display: none;
  }
  .bake-core-mini {
    width: 76px;
    height: 76px;
    border-width: 6px;
  }
  .bake-core-mini b { font-size: 17px; }
  .bake-core-mini span { font-size: 8px; }
  .lower-panels {
    padding: 0 16px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
