:root {
  color-scheme: dark;
  --bg: #14110c;
  --panel: #1e1a14;
  --ink: #f3e6c8;
  --muted: #b7a88a;
  --line: #3a3224;
  --ok: #d7b56d;
  --bad: #d36c4f;
  --idle: #8d7f64;
  font-family: "Iosevka", "IBM Plex Mono", "ui-monospace", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); min-height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--line);
}
.eyebrow { margin: 0; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.7rem; }
h1, h2 { margin: 0.15rem 0 0; font-weight: 600; }
h1 { font-size: 1.4rem; }
h2 { font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 1.25rem; }
#status { margin: 0; color: var(--ok); }
#status[data-tone="bad"] { color: var(--bad); }
#status[data-tone="idle"] { color: var(--idle); }

main { padding: 1.25rem 1.5rem 2rem; flex: 1; }
.layout { display: grid; grid-template-columns: minmax(16rem, 22rem) 1fr; gap: 1.25rem; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 1rem 1.1rem 1.2rem; }
dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 0.8rem; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.caps { list-style: none; margin: 0.4rem 0 0; padding: 0; font-size: 0.78rem; }
.caps li { padding: 0.15rem 0; border-bottom: 1px solid #2a241a; }
.world-wrap { margin: 0; }
canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #0b0a08;
  border: 1px solid var(--line);
  image-rendering: pixelated;
}
figcaption { color: var(--muted); font-size: 0.75rem; margin-top: 0.5rem; }
#incompatible { max-width: 40rem; }

@media (max-width: 840px) {
  .layout { grid-template-columns: 1fr; }
}

.stack {
  display: grid;
  gap: 16px;
  align-content: start;
}

.fields {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
}

.fields li {
  border: 1px dashed currentColor;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.85rem;
  opacity: 0.7;
}

.fields li::after {
  content: " · pending";
  opacity: 0.6;
}

.flow {
  margin: 0;
  padding-left: 20px;
  font-size: 0.85rem;
  line-height: 1.6;
}

.note {
  font-size: 0.85rem;
  line-height: 1.5;
  opacity: 0.8;
}

/* FULL_VIEW: the world canvas keeps a 16:9 box; its backing store follows the box at the
   device pixel ratio, clamped by the frozen ClientCompatibilityProfile. */
.full-view #world { aspect-ratio: 16 / 9; height: auto; }

/* Playtest account screens (/?play): the same panel look, one column of fields. */
.account-form { display: grid; gap: 0.35rem; max-width: 24rem; margin-top: 0.75rem; }
.account-form label { color: var(--muted); font-size: 0.8rem; margin-top: 0.4rem; }
.account-form input, .account-form select {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 0.4rem 0.5rem;
}
.account button {
  font: inherit;
  color: var(--bg);
  background: var(--ok);
  border: 1px solid var(--ok);
  padding: 0.4rem 0.8rem;
  cursor: pointer;
}
.account button.link { color: var(--ok); background: none; border: none; padding: 0; text-decoration: underline; }
.account[data-busy="true"] button { opacity: 0.5; pointer-events: none; }
.account-message { margin: 0.75rem 0 0; }
.account-message[data-tone="bad"] { color: var(--bad); }
.account-message[data-tone="ok"] { color: var(--ok); }
.account .character { border: 1px solid var(--line); padding: 0.75rem; margin-top: 0.75rem; }
.account .character h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.account .character h4 { margin: 0.6rem 0 0.2rem; font-size: 0.8rem; color: var(--muted); }
.account .items { margin: 0 0 0.6rem; padding-left: 1.1rem; }
