/* The craft labs' wrapper (labs/craft/craft.js): the labs home's look, a bar
   on top and our build of the app below it. */
:root{color-scheme:dark;
  --ui-dark:#0a0a0a;--ui-dark2:#1a1a1a;--ui-dark3:#333333;
  --accent:#3b82f6;--amber:#fbbf24;--ok:#22c55e;--bad:#ef4444;
  --text-light:#f0f0f0;--text-dim:#888888;
  --rainbow:linear-gradient(90deg,#7AC143,#F7941E,#ED1C45,#EC008C,#92278F,#2E3192,#00AEEF);
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',system-ui,sans-serif;
  background:var(--ui-dark);color:var(--text-light);
  display:flex;flex-direction:column;min-height:100vh;overflow:hidden;
}
body.craft-page{overflow:auto}

/* ── The bar ─────────────────────────────── */
.craft-bar{
  position:relative;flex:0 0 auto;display:flex;align-items:center;gap:12px;
  min-height:52px;padding:8px 14px;background:var(--ui-dark2);
}
.craft-bar::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;background:var(--rainbow);opacity:.9}
.craft-home{flex:0 0 auto;color:var(--text-dim);text-decoration:none;font-size:12.5px;font-weight:600;
  padding:6px 9px;border:1px solid var(--ui-dark3);border-radius:7px}
.craft-home:hover,.craft-home:focus-visible{color:#fff;border-color:var(--accent);outline:none}
.craft-title{display:flex;align-items:baseline;gap:9px;min-width:0;flex:0 1 auto}
.craft-title h1{font-size:16px;font-weight:800;letter-spacing:.2px;white-space:nowrap}
.craft-sub{font-size:11px;font-weight:600;letter-spacing:1.6px;text-transform:uppercase;color:var(--text-dim);white-space:nowrap}
.craft-reminder{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:8px;
  font-size:12px;line-height:1.35;color:#fde68a}
.craft-reminder[hidden]{display:none}
.craft-reminder[data-kind=links]{color:#cfd8e3}
.craft-reminder span{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.craft-reminder button{flex:0 0 auto;background:none;border:1px solid #6b5a1e;border-radius:6px;color:#fde68a;
  font:700 11px system-ui,Segoe UI,sans-serif;padding:4px 8px;cursor:pointer}
.craft-spacer{flex:1 1 auto}
.craft-actions{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.craft-btn{background:none;border:1px solid var(--ui-dark3);border-radius:7px;color:#cfd8e3;
  font:600 12px system-ui,Segoe UI,sans-serif;padding:7px 11px;cursor:pointer;white-space:nowrap;text-decoration:none}
.craft-btn:hover,.craft-btn:focus-visible{color:#fff;border-color:var(--accent);outline:none}
.craft-btn[hidden]{display:none}
.craft-btn-go{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:700}
.craft-btn-go:hover,.craft-btn-go:focus-visible{background:#2f6fdb;border-color:#2f6fdb}
.craft-btn-go.is-done{background:rgba(34,197,94,.14);border-color:var(--ok);color:#bbf7d0}
.craft-download{font-size:11.5px;color:var(--text-dim);white-space:nowrap}
.craft-download[hidden]{display:none}

/* ── The app ─────────────────────────────── */
.craft-main{flex:1 1 auto;position:relative;min-height:0;display:flex}
.craft-frame{flex:1 1 auto;width:100%;height:100%;border:0;display:block;background:#262626}

/* ── Notices (not installed, no WebGL2, narrow screen) ── */
.craft-notice{margin:auto;max-width:560px;padding:34px 24px;text-align:center}
.craft-notice[hidden]{display:none}
.craft-notice .craft-icon{width:54px;height:54px;margin:0 auto 16px;border-radius:13px;display:flex;align-items:center;justify-content:center;
  background:rgba(59,130,246,.12);color:var(--accent)}
.craft-notice .craft-icon svg{width:28px;height:28px}
.craft-notice h2{font-size:20px;font-weight:800;margin-bottom:10px}
.craft-notice p{font-size:14px;line-height:1.6;color:#b9bcc2;margin-bottom:12px}
.craft-notice .craft-notice-actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:18px}

/* ── Dialogs ─────────────────────────────── */
.craft-dialog{margin:auto;width:min(560px,calc(100vw - 32px));max-height:calc(100vh - 48px);
  background:#16161c;color:var(--text-light);border:1px solid var(--ui-dark3);border-radius:14px;
  padding:22px 24px;box-shadow:0 18px 60px rgba(0,0,0,.6)}
.craft-dialog::backdrop{background:rgba(0,0,0,.62)}
.craft-dialog h2{font-size:19px;margin-bottom:8px}
.craft-dialog p{font-size:13.5px;line-height:1.55;color:#aab;margin-bottom:12px}
.craft-dialog a{color:#9cc3ff}
.craft-dialog dl{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;font-size:13px;margin:0 0 14px}
.craft-dialog dt{color:var(--text-dim);font-weight:700}
.craft-dialog dd{color:#e6e6ec;word-break:break-word}
.craft-dialog-btns{display:flex;gap:10px;justify-content:flex-end;margin-top:14px}
.craft-files{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px}
.craft-licence-text{white-space:pre-wrap;font:12px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;color:#c8c8d0;
  background:#0d0d10;border:1px solid #26262c;border-radius:8px;padding:10px 12px;max-height:38vh;overflow:auto}
.craft-licence-text[hidden]{display:none}
.craft-drop{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
  border:2px dashed #3d3d48;border-radius:12px;padding:22px 14px;text-align:center;cursor:pointer;
  font-size:13.5px;color:#cfd8e3;background:#101016}
.craft-drop:hover,.craft-drop.is-over,.craft-drop:focus-within{border-color:var(--accent);background:#111a2a}
.craft-drop small{color:var(--text-dim);font-size:11.5px}
.craft-drop input{position:absolute;width:1px;height:1px;opacity:0}
.craft-status{min-height:20px;margin-top:10px;font-size:12.5px;color:#aab}
.craft-status.is-bad{color:#f87171}
.craft-status.is-good{color:#86efac}
.craft-thumb{display:flex;gap:12px;align-items:center;margin-top:12px;padding:10px;border:1px solid #26262c;border-radius:10px;background:#101016}
.craft-thumb[hidden]{display:none}
.craft-thumb canvas{max-width:96px;max-height:72px;width:auto;height:auto;background:#000;border-radius:6px;flex:0 0 auto}
.craft-thumb canvas[hidden]{display:none}
.craft-dialog .craft-privacy{font-size:12.5px;color:#cfe6b6}
.craft-thumb span{font-size:12.5px;color:#cfe6b6}

@media (max-width:899px){
  .craft-sub{display:none}
}
@media (max-width:520px){
  .craft-bar{gap:8px;padding:8px 10px}
  .craft-title h1{font-size:15px}
}
body[data-state=narrow] .craft-actions,body[data-state=narrow] .craft-reminder{display:none}
