/* Layout idea: questionnaire on the left, the printed-style label fixed on the right as the thing being made. */
:root {
  --paper: #eef1f6;
  --surface: #ffffff;
  --ink: #131a2b;
  --muted: #566076;
  --line: #c9d0dd;
  --accent: #2f3fd6;
  --accent-soft: #dfe3fb;
  --on-accent: #ffffff;
  --danger: #b3261e;
  --display: "Archivo", "Arial Narrow", Arial, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1320;
    --surface: #181d2e;
    --ink: #e8ebf5;
    --muted: #9aa3b8;
    --line: #353d55;
    --accent: #8b97ff;
    --accent-soft: #252c52;
    --on-accent: #0f1320;
    --danger: #ff9a8f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1320;
  --surface: #181d2e;
  --ink: #e8ebf5;
  --muted: #9aa3b8;
  --line: #353d55;
  --accent: #8b97ff;
  --accent-soft: #252c52;
  --on-accent: #0f1320;
  --danger: #ff9a8f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
}
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
header { display: flex; flex-direction: column; gap: 8px; }
.brand {
  font-family: var(--display);
  font-stretch: 80%;
  font-weight: 900;
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0;
}
.brand span { color: var(--accent); }
.lede { margin: 0; max-width: 62ch; color: var(--muted); }
.cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  gap: 32px;
  align-items: start;
}
@media (max-width: 860px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
}
h2 {
  font-family: var(--display);
  font-stretch: 85%;
  font-weight: 800;
  font-size: 20px;
  margin: 0;
  text-wrap: balance;
}
form { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label, .legend { font-size: 13px; font-weight: 600; color: var(--muted); }
input[type="text"] {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  width: 100%;
}
.area {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  min-width: 0;
}
.area-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.area-name { font-weight: 600; }
.area-weight { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  font-size: 14px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  background: var(--paper);
  user-select: none;
}
.seg input:checked + label { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.check.off { color: var(--muted); opacity: 0.55; }
.side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 16px; min-width: 0; }
@media (max-width: 860px) { .side { position: static; } }

/* The label */
.label {
  background: var(--surface);
  border: 3px solid var(--ink);
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.label-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; border-bottom: 8px solid var(--ink); padding-bottom: 6px; }
.label-brand { font-family: var(--display); font-stretch: 78%; font-weight: 900; font-size: 30px; line-height: 1; }
.label-ver { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.label-game { font-weight: 600; overflow-wrap: anywhere; }
.label-studio { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.score-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; border-bottom: 4px solid var(--ink); padding-bottom: 8px; flex-wrap: wrap; }
.score { font-family: var(--display); font-stretch: 80%; font-weight: 900; font-size: 56px; line-height: 0.9; font-variant-numeric: tabular-nums; }
.score small { font-family: var(--mono); font-size: 13px; font-weight: 400; color: var(--muted); }
.band { background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 14px; padding: 4px 10px; border-radius: 4px; }
.rows { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.row-name { font-size: 14px; font-weight: 600; }
.row-pts { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.row-desc { font-size: 12.5px; color: var(--muted); }
.row-bar { grid-column: 1 / -1; height: 5px; background: var(--accent-soft); border-radius: 3px; overflow: hidden; }
.row-bar i { display: block; height: 100%; background: var(--accent); }
.live { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; }
.fine { font-size: 12px; color: var(--muted); margin: 0; }

.panel { display: flex; flex-direction: column; gap: 10px; }
.badge-box { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; overflow-x: auto; }
.badge-box svg { display: block; max-width: none; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* A class that sets display (.pub, .btns) would otherwise show an element marked hidden. */
[hidden] { display: none !important; }
button {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
}
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.status { font-size: 13px; color: var(--muted); min-height: 1.2em; }
textarea {
  width: 100%;
  min-height: 84px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  resize: vertical;
}
.method { border-top: 1px solid var(--line); padding-top: 20px; display: flex; flex-direction: column; gap: 10px; max-width: 70ch; }
.method p { margin: 0; color: var(--muted); font-size: 14.5px; }
.method code { font-family: var(--mono); font-size: 13px; color: var(--ink); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Published label page and publish panel */
.pub { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.pub a, .page-links a, .label-store a { color: var(--accent); overflow-wrap: anywhere; }
.pub p { margin: 0; font-size: 14px; }
.error { color: var(--danger); font-weight: 600; }
.narrow { max-width: 460px; margin: 0 auto; padding: 32px 20px 64px; display: flex; flex-direction: column; gap: 20px; }
.page-links { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; }
.label-store { font-size: 13px; }
.label-date { font-family: var(--mono); font-size: 11px; color: var(--muted); }
