:root{
  --bg:#09090b;
  --panel:#0d0d10;
  --panel2:#111114;
  --line:#202026;
  --line2:#292930;
  --text:#f3f3f5;
  --muted:#8b8b96;
  --dim:#5f5f69;
  --accent:#f5f5f5;
  --black:#050506;
  --radius:14px;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--bg);color:var(--text);font-family:"Geist",system-ui,sans-serif;overflow:hidden}
button,input,textarea{font:inherit}
button{color:inherit}
.app-shell{height:100vh;display:flex;flex-direction:column;background:
  radial-gradient(circle at 60% -20%,rgba(255,255,255,.035),transparent 30%),
  var(--bg)}
.topbar{height:64px;flex:0 0 auto;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 18px}
.brand{display:flex;align-items:center;gap:11px}
.brand-mark{width:32px;height:32px;border:1px solid #34343d;border-radius:9px;display:grid;place-items:center;background:linear-gradient(145deg,#1e1e24,#0d0d10);font-weight:700;font-size:14px;box-shadow:inset 0 1px rgba(255,255,255,.08)}
.brand-name{font-weight:650;font-size:14px;letter-spacing:-.2px}
.brand-sub{font-size:11px;color:var(--dim);margin-top:1px}
.top-actions{display:flex;align-items:center;gap:8px}
.button,.toolbar-button,.icon-button,.chip{border:1px solid var(--line2);background:#111115;border-radius:8px;cursor:pointer;transition:.15s ease}
.button{padding:8px 11px;font-size:12px;font-weight:550}
.button:hover,.toolbar-button:hover,.icon-button:hover,.chip:hover{background:#17171c;border-color:#383842}
.button.primary{background:#eee;color:#09090b;border-color:#eee}
.button.primary:hover{background:#fff}
.status-pill{display:flex;align-items:center;gap:7px;font-size:11px;color:#9a9aa5;border:1px solid var(--line);padding:7px 9px;border-radius:999px;margin-right:4px}
.status-dot{width:6px;height:6px;background:#8dffb0;border-radius:50%;box-shadow:0 0 8px rgba(141,255,176,.4)}
.status-pill.busy .status-dot{background:#fff;animation:pulse 1s infinite}
.status-pill.error .status-dot{background:#ff7272}
@keyframes pulse{50%{opacity:.25}}
.workspace{min-height:0;flex:1;display:grid;grid-template-columns:330px minmax(0,1fr)}
.left-panel{border-right:1px solid var(--line);background:#0b0b0e;overflow:auto;padding:12px;display:flex;flex-direction:column;gap:12px}
.panel-card{border:1px solid var(--line);background:linear-gradient(180deg,#0f0f12,#0c0c0f);border-radius:var(--radius);padding:14px}
.prompt-card{flex:0 0 auto}
.section-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.section-head.compact{align-items:center}
.eyebrow{font-family:"Geist Mono",monospace;font-size:9px;letter-spacing:1.4px;color:#6c6c77;margin-bottom:5px}
h1,h2{margin:0;font-weight:600;letter-spacing:-.4px}
h1{font-size:18px}
h2{font-size:15px}
.icon-button{width:27px;height:27px;font-size:18px;color:#73737d}
#promptInput{width:100%;height:180px;resize:vertical;min-height:110px;max-height:340px;margin-top:14px;border:1px solid #24242a;background:#09090b;color:#e8e8eb;border-radius:10px;padding:12px;font-size:12.5px;line-height:1.55;outline:none}
#promptInput:focus{border-color:#41414a;box-shadow:0 0 0 2px rgba(255,255,255,.025)}
#promptInput::placeholder{color:#55555f}
.prompt-tools{display:flex;gap:6px;margin-top:9px;flex-wrap:wrap}
.chip{font-size:10.5px;padding:6px 8px;color:#83838e}
.chip.active{color:#eee;background:#1a1a20;border-color:#3a3a45}
.build-options{margin-top:13px;border-top:1px solid var(--line);padding-top:7px}
.option-row{display:flex;align-items:center;justify-content:space-between;padding:7px 1px;font-size:11px;color:#9696a1}
.switch{width:29px;height:16px;border-radius:99px;background:#222228;border:1px solid #313139;display:flex;align-items:center;padding:2px;cursor:pointer}
.switch span{width:10px;height:10px;border-radius:50%;background:#676771;transition:.18s;transform:translateX(0)}
.switch.on{background:#e7e7e9;border-color:#e7e7e9}
.switch.on span{background:#09090b;transform:translateX(13px)}
.generate-button{width:100%;height:40px;border:0;border-radius:10px;background:#f1f1f2;color:#080809;font-weight:650;margin-top:12px;cursor:pointer;display:flex;align-items:center;justify-content:space-between;padding:0 12px;box-shadow:0 1px 0 #fff inset}
.generate-button:hover{background:white}
.generate-button:disabled{opacity:.45;cursor:not-allowed}
.shortcut{font-family:"Geist Mono";font-size:9px;color:#5e5e64;font-weight:500}
.model-note{display:flex;justify-content:space-between;font-size:9px;color:#55555f;margin-top:8px;font-family:"Geist Mono"}
.model-note strong{font-weight:500;color:#777782}
.history-card{flex:1;min-height:160px}
.count{font-family:"Geist Mono";font-size:10px;color:#666671}
.history-list{margin-top:10px;display:flex;flex-direction:column;gap:6px}
.empty-state{font-size:11px;color:#50505a;padding:10px 2px}
.history-item{border:1px solid #202026;border-radius:9px;padding:9px;cursor:pointer;background:#0b0b0e}
.history-item:hover{background:#111115}
.history-title{font-size:11px;color:#d2d2d7;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.history-meta{font-family:"Geist Mono";font-size:9px;color:#555560;margin-top:4px}
.main-panel{min-width:0;display:flex;flex-direction:column;background:#08080a}
.tabs{height:43px;border-bottom:1px solid var(--line);display:flex;align-items:center;padding:0 10px;gap:2px;background:#0b0b0d}
.tab{height:100%;padding:0 11px;border:0;background:transparent;color:#6f6f7a;font-size:11px;cursor:pointer;border-bottom:1px solid transparent}
.tab:hover{color:#bdbdc5}
.tab.active{color:#eee;border-bottom-color:#eee}
.tab-spacer{flex:1}
.toolbar-button{padding:5px 8px;font-size:10px;color:#85858f}
.badge{display:inline-grid;place-items:center;min-width:15px;height:15px;padding:0 4px;background:#522;color:#ffb3b3;border-radius:99px;font-size:8px;margin-left:3px}
.hidden{display:none!important}
.stage{min-height:0;flex:1;position:relative}
.tab-pane{display:none;position:absolute;inset:0}
.tab-pane.active{display:block}
#previewPane{background:#050506}
#gameFrame{width:100%;height:100%;border:0;background:white}
.preview-empty{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#60606a;text-align:center;padding:20px}
.preview-icon{font-size:34px;color:#383840;margin-bottom:10px}
.preview-empty h2{font-size:15px;color:#777781}
.preview-empty p{font-size:11px;max-width:330px;line-height:1.5}
.editor-wrap{height:100%;display:grid;grid-template-columns:auto 1fr;background:#09090b;overflow:hidden}
.editor-gutter{min-width:46px;padding:15px 10px;text-align:right;color:#44444e;border-right:1px solid #18181d;font:11px/1.6 "Geist Mono",monospace;white-space:pre;overflow:hidden;user-select:none}
#codeEditor{width:100%;height:100%;resize:none;border:0;outline:0;padding:15px;background:#09090b;color:#d7d7dc;font:11px/1.6 "Geist Mono",monospace;tab-size:2;white-space:pre;overflow:auto}
.console-head{height:38px;border-bottom:1px solid #1c1c21;display:flex;align-items:center;justify-content:space-between;padding:0 10px;color:#757580;font-size:10px}
.console-output{height:calc(100% - 38px);overflow:auto;padding:10px;font:10.5px/1.55 "Geist Mono",monospace;background:#09090b}
.console-line{padding:3px 6px;border-bottom:1px solid #151519;white-space:pre-wrap;word-break:break-word}
.console-line.log{color:#9898a2}
.console-line.warn{color:#e2c98d}
.console-line.error{color:#ff8a8a}
.console-placeholder{color:#45454e}
.bottom-bar{height:36px;flex:0 0 auto;border-top:1px solid var(--line);background:#0b0b0d;display:flex;align-items:center;justify-content:space-between;padding:0 11px;font-size:9px;color:#5d5d67}
.project-name-wrap{display:flex;align-items:center;gap:7px}
#projectName{border:0;outline:0;background:transparent;color:#a7a7b0;font-size:10px;width:190px}
.muted{color:#50505a}
.bottom-meta{display:flex;gap:6px;align-items:center}
.separator{color:#313139}
.toast-container{position:fixed;right:14px;bottom:48px;display:flex;flex-direction:column;gap:8px;z-index:9999}
.toast{background:#151519;border:1px solid #33333b;color:#d9d9de;border-radius:9px;padding:9px 11px;max-width:310px;font-size:11px;box-shadow:0 8px 30px rgba(0,0,0,.35)}
.toast.error{border-color:#5a2e2e;color:#ffb5b5}

@media(max-width:800px){
  html,body{overflow:auto}
  .app-shell{min-height:100vh;height:auto}
  .topbar{height:auto;min-height:60px;padding:10px;gap:10px;align-items:flex-start}
  .brand-sub{display:none}
  .top-actions{flex-wrap:wrap;justify-content:flex-end}
  .status-pill{display:none}
  .workspace{grid-template-columns:1fr;display:flex;flex-direction:column}
  .left-panel{border-right:0;border-bottom:1px solid var(--line);overflow:visible}
  .history-card{display:none}
  .main-panel{height:70vh;min-height:520px}
  .button{padding:7px 8px}
  #promptInput{height:130px}
}
