/* The poster maker's three pages: the code box (enter.html), the maker (app.html) and the codes
   page (admin.html). Phone first, one column: the preview on top and the form under it. From 900px
   wide the preview sticks on the left and the form scrolls on the right. One dark look: ink and red.
   The fonts are Archivo's five cuts the posters use, served from this folder, so the page asks no
   other site for anything. */
@font-face { font-family: "MakeSemi"; src: url("/make/fonts/semi.woff") format("woff"); font-display: swap; }
@font-face { font-family: "MakeBold"; src: url("/make/fonts/bold.woff") format("woff"); font-display: swap; }
@font-face { font-family: "MakeBlack"; src: url("/make/fonts/black.woff") format("woff"); font-display: swap; }
@font-face { font-family: "MakeWide"; src: url("/make/fonts/wide.woff") format("woff"); font-display: swap; }
@font-face { font-family: "MakeTall"; src: url("/make/fonts/tall.woff") format("woff"); font-display: swap; }

:root {
  --bg: #141211;
  --panel: #1d1b1a;
  --raise: #262321;
  --line: #34302d;
  --ink: #201e1d;
  --fg: #f4f1ee;
  --muted: #a8a19a;
  --red: #ec3013;
  --red-hi: #ff4a2b;
  --focus: #ffb4a6;
  --ok: #8fd18b;
  --bad: #ffc7bd;
  --semi: "MakeSemi", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bold: "MakeBold", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wide: "MakeWide", "MakeBold", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--semi); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
b, strong { font-family: var(--bold); font-weight: normal; }
.wrap { max-width: 1120px; margin: 0 auto; padding-block: 18px 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap.narrow { max-width: 460px; }

.top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; min-width: 0; }
.top svg { height: 26px; width: auto; display: block; flex: none; }
.top .word { font-family: var(--wide); font-size: 15px; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.top .who { margin-left: auto; min-width: 0; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.top .who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.intro { color: var(--muted); font-size: 14.5px; max-width: 62ch; margin: -6px 0 20px; }
.intro b { color: var(--fg); }

.layout { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .layout { grid-template-columns: minmax(0, 430px) minmax(0, 1fr); gap: 40px; align-items: start; }
  .stage { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px); }
}

.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 4px; gap: 4px; margin-bottom: 12px; }
.seg button { appearance: none; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: 14px/1 var(--bold);
  padding: 11px 8px; cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--raise); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
.seg small { font-family: var(--semi); opacity: .7; margin-left: 4px; font-variant-numeric: tabular-nums; }

.frame { position: relative; background: #0c0b0b; border-radius: 12px; overflow: hidden; border: 1px solid var(--line);
  display: flex; justify-content: center; min-height: 200px; }
.frame img { display: block; width: 100%; height: auto; max-height: 72vh; object-fit: contain; }
.frame.story img { width: auto; max-width: 100%; }
.frame .loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; padding: 16px; text-align: center; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.btn { appearance: none; border: 0; border-radius: 9px; padding: 14px 12px; font: 15px/1 var(--bold); cursor: pointer;
  white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-hi); }
.btn.quiet { background: var(--raise); color: var(--fg); border: 1px solid var(--line); }
.btn.small { padding: 9px 12px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.hint { color: var(--muted); font-size: 13px; margin: 10px 2px 0; min-height: 1.2em; }
.hint.bad, .msg.bad { color: var(--bad); }
.msg { font-size: 14px; margin: 12px 0 0; min-height: 1.3em; color: var(--muted); }
.msg.ok { color: var(--ok); }
/* Paint my spot's progress: fills over about a minute while the painting is made. */
.bar { height: 6px; margin-top: 10px; border-radius: 3px; background: var(--raise); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--red); border-radius: 3px; transition: width 1s linear; }
@media (prefers-reduced-motion: reduce) { .bar i { transition: none; } }

.form { display: grid; gap: 18px; min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 16px 16px; min-width: 0; }
.card h1, .card h2 { margin: 0 0 4px; font: 13px/1.3 var(--wide); letter-spacing: .12em; text-transform: uppercase; color: var(--fg); }
.card .sub { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }
.card + .card { margin-top: 18px; }
.form .card + .card { margin-top: 0; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.field { display: grid; gap: 6px; min-width: 0; margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field.gap { margin-top: 14px; }
label, .lab { font: 13px/1.45 var(--bold); color: var(--fg); }
.lab .opt, label .opt { color: var(--muted); font-family: var(--semi); }
input[type="text"], input[type="password"], input[type="date"], input[type="time"], select, textarea {
  width: 100%; min-width: 0; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 12px; font: 16px/1.25 var(--semi); }
textarea { font-size: 14.5px; line-height: 1.5; resize: vertical; min-height: 150px; }
textarea.short { min-height: 90px; }
input.code { font: 22px/1.2 var(--wide); letter-spacing: .12em; text-transform: uppercase; text-align: center; padding: 14px 12px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, .tile:focus-visible, .file:focus-within {
  outline: 2px solid var(--focus); outline-offset: 2px; }
.count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; justify-self: end; margin-top: -2px; }
.warn { font-size: 12.5px; color: var(--bad); margin: 0; }

.file { position: relative; display: flex; align-items: center; gap: 12px; background: var(--bg); border: 1px dashed var(--line);
  border-radius: 9px; padding: 10px 12px; cursor: pointer; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file .thumb { width: 44px; height: 44px; border-radius: 8px; background: var(--raise); display: grid; place-items: center; overflow: hidden; flex: none; }
.file .thumb img, .file .thumb canvas { width: 100%; height: 100%; object-fit: contain; }
.file .txt { font: 14px/1.45 var(--bold); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .txt small { display: block; color: var(--muted); font: 12.5px/1.45 var(--semi); }

.colours { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.swatch { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; }
.swatch input[type="color"] { width: 38px; height: 38px; border: 0; padding: 0; background: none; border-radius: 6px; cursor: pointer; flex: none; }
.swatch code { font: 13px/1 ui-monospace, "SF Mono", Menlo, monospace; color: var(--muted); }
.linkbtn { appearance: none; background: none; border: 0; color: var(--focus); font: 13px/1 var(--bold); padding: 6px 0; cursor: pointer;
  white-space: nowrap; text-decoration: none; justify-self: start; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { appearance: none; border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 999px; padding: 9px 14px;
  font: 14px/1 var(--bold); cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--ink); border-color: var(--fg); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.tile { appearance: none; padding: 0; border: 2px solid transparent; border-radius: 10px; background: var(--bg); cursor: pointer; overflow: hidden;
  text-align: left; color: var(--fg); display: grid; font: inherit; }
.tile img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.tile span { font: 12.5px/1.45 var(--bold); padding: 6px 7px 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile small { font-size: 11.5px; color: var(--muted); padding: 0 7px 7px; white-space: nowrap; }
.tile[aria-pressed="true"] { border-color: var(--red); }
.tile .ph { aspect-ratio: 4 / 5; display: grid; place-items: center; background: var(--raise); color: var(--muted);
  font: 12px/1.3 var(--bold); text-align: center; padding: 8px; white-space: normal; overflow: hidden; }
.tile .ph.full { padding: 0; }
.tile .ph img { width: 100%; height: 100%; object-fit: cover; }
.tile.soon { cursor: default; opacity: .7; border: 1px dashed var(--line); }
.tile.photo { position: relative; }
.tile.photo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.paint { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 14px; padding: 14px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.paint .sub { margin: 0; }
.paint .sub b { color: var(--fg); white-space: nowrap; }
.paint .msg { margin: 0; }
.paint .tiles:empty { display: none; }
.range { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
input[type="range"] { width: 100%; accent-color: var(--red); }
.range output { font: 13px/1 var(--bold); color: var(--muted); font-variant-numeric: tabular-nums; min-width: 3.5ch; text-align: right; }

.copyrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 2px 0 8px; }
.copyrow.gap { margin-top: 14px; }
.copyrow .lab { margin: 0; }
.copied { color: var(--ok); font: 12.5px/1 var(--bold); }
.checks { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 14px; }
.checks li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; color: var(--fg); }
.checks li::before { content: ""; width: 14px; height: 14px; margin-top: 3px; border: 2px solid var(--red); border-radius: 3px; }
.foot { color: var(--muted); font-size: 12.5px; margin-top: 28px; max-width: 70ch; }
.foot a { color: var(--muted); }

/* The codes page. */
.rows { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.row { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 8px; min-width: 0; }
.row .head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row .name { font: 15px/1.3 var(--bold); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .state { margin-left: auto; font: 11.5px/1 var(--wide); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  padding: 5px 7px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); }
.row .state.on { color: var(--ok); border-color: #3b5a39; }
.row .state.flag { color: #fff; background: var(--red); border-color: var(--red); }
.row .codeval { font: 15px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .08em; user-select: all; }
.row .meta { color: var(--muted); font-size: 12.5px; }
.row .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.log { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.log li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
.log time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.log .flagged { color: var(--bad); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
