/* Yodacon Ship Pack — playground. Plain CSS, light and dark. */
:root {
  --bg: #f2f3f8; --card: #ffffff; --ink: #161a24; --muted: #5a6276; --line: #c8ccd9;
  --link: #1b4fb8; --accent: #1b4fb8; --accent-ink: #ffffff;
  --code-bg: #fbfbfd; --gutter: #eef0f6; --warn: #8a5a00; --err: #b3261e; --ok: #1d6b3a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #090b12; --card: #121624; --ink: #dfe4f2; --muted: #8f98b3; --line: #2a3150;
    --link: #8db6ff; --accent: #8db6ff; --accent-ink: #0a0d16;
    --code-bg: #0d1020; --gutter: #10142a; --warn: #f0c060; --err: #ff8a80; --ok: #7ef0a8;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; display: flex; flex-direction: column; min-height: 100%;
  background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, sans-serif;
}
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Top bar ---------------------------------------------------------------- */
.bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
}
.bar h1 { margin: 0; font-size: 18px; }
.crumbs { margin: 0; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.field, .check { display: inline-flex; align-items: center; gap: 6px; }
select, button { font: inherit; color: inherit; }
select { padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); }
button {
  padding: 5px 12px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--card); cursor: pointer;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.small { padding: 1px 8px; font-size: 12px; }

/* Two panes --------------------------------------------------------------- */
.panes {
  flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px; padding: 12px 16px; min-height: 0;
}
.pane {
  display: flex; flex-direction: column; min-width: 0; min-height: 520px;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card);
}
.pane-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 4px 10px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line);
}
.status { font-variant-numeric: tabular-nums; }

/* The editor: a textarea with a line-number gutter that scrolls with it. */
.editor { flex: 1; display: flex; min-height: 0; position: relative; background: var(--code-bg); }
.gutter, #code {
  margin: 0; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2;
}
.gutter {
  /* Absolutely placed so its (long) content never sizes the pane. */
  position: absolute; left: 0; top: 0; bottom: 0; width: 3.2em; box-sizing: border-box; padding: 10px 6px 10px 0; text-align: right; color: var(--muted);
  background: var(--gutter); border-right: 1px solid var(--line); overflow: hidden; user-select: none;
}
#code {
  flex: 1; min-width: 0; margin-left: 3.2em; padding: 10px; border: 0; resize: none; outline: none;
  background: transparent; color: var(--ink); white-space: pre; overflow: auto;
}

/* Preview + console stacked on the right. */
.frame-wrap { flex: 3; min-height: 260px; background: #05060b; }
#preview { display: block; width: 100%; height: 100%; border: 0; background: #05060b; }
.console-head { border-top: 1px solid var(--line); }
.console {
  flex: 1; min-height: 110px; max-height: 32vh; margin: 0; padding: 4px 0; list-style: none; overflow: auto;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--code-bg);
}
.console li { padding: 1px 10px; white-space: pre-wrap; word-break: break-word; border-bottom: 1px solid color-mix(in srgb, var(--line) 40%, transparent); }
.console li.warn { color: var(--warn); }
.console li.error { color: var(--err); }
.console li.info { color: var(--muted); }
.console li.system { color: var(--ok); font-style: italic; }

.foot { padding: 4px 16px 14px; font-size: 13px; color: var(--muted); }
.foot p { margin: 4px 0; max-width: 1100px; }

@media (max-width: 820px) {
  .panes { grid-template-columns: minmax(0, 1fr); }
  .pane { min-height: 360px; }
  .editor-pane { height: 62vh; }
  .tools { margin-left: 0; }
}
