/* Layout: one narrow column on black lacquer. The plate sits on top and is the progress display; one question sits under it. */
:root {
  --ink: #0E0D0B;
  --surface: #17150F;
  --line: #2C281E;
  --text: #EDE7D9;
  --muted: #9A917D;
  --gold: #C8A84B;
  --gold-dim: #7A6830;
  --err: #D9826A;
  --display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--ink); color: var(--text); font-family: var(--body); font-size: 16px; line-height: 1.55; }
.wrap {
  max-width: 680px; margin: 0 auto;
  padding-block: 28px 64px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 24px;
}
.label { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.label.gold { color: var(--gold); }
header { display: flex; flex-direction: column; gap: 6px; }
h1 { font-family: var(--display); font-weight: 600; font-size: clamp(32px, 7vw, 44px); line-height: 1; margin: 0; }
h1 em { font-weight: 500; color: var(--gold); }
p { margin: 0; }

#plateBox { width: 100%; max-width: 420px; margin: 0 auto; }
#plateBox.tap { cursor: pointer; }
#plateBox:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
#plateBox svg { display: block; width: 100%; height: auto; }
#plateBox .shard { transition: transform 0.75s cubic-bezier(0.2, 0.9, 0.25, 1); }
#plateBox .fade { transition: opacity 0.8s ease; }
#plateBox text { font-family: var(--body); }

.pieces { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; font-size: 14px; }
.pieces li { display: flex; gap: 6px; align-items: baseline; }
.pieces .num { color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; }
.pieces .share { color: var(--muted); font-variant-numeric: tabular-nums; }

.rail { list-style: none; margin: 0; padding: 10px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rail li { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rail .name { font-family: var(--display); font-size: 19px; font-weight: 600; line-height: 1.1; color: var(--muted); }
.rail li.now .name { color: var(--gold); }
.rail li.done .name { color: var(--text); }
.rail .what { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }

.talk { display: flex; flex-direction: column; gap: 18px; }
.turn { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.turn p { white-space: pre-wrap; overflow-wrap: anywhere; }
.turn.q p { font-family: var(--display); font-size: 25px; line-height: 1.28; font-weight: 500; }
.turn.a p { color: var(--muted); }
.turn.wait p { color: var(--gold-dim); font-style: italic; }
details { font-size: 14px; }
summary { cursor: pointer; color: var(--muted); }
details .turn.q p { font-size: 19px; }
details > .turn, details > .block { margin-top: 12px; }
.block { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; background: var(--surface); border: 1px solid var(--line); padding: 14px 16px; margin: 0; font-family: var(--body); color: var(--text); }
.block.join { border-color: var(--gold-dim); }

.composer { display: flex; flex-direction: column; gap: 10px; }
textarea { width: 100%; min-height: 110px; resize: vertical; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 0; padding: 14px 16px; font: inherit; }
textarea:focus-visible, button:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
button {
  font: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  border-radius: 0; border: 1px solid var(--gold); background: var(--gold); color: var(--ink);
  padding: 12px 18px; cursor: pointer; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
button:hover { background: var(--text); border-color: var(--text); }
button.quiet { background: transparent; color: var(--text); border-color: var(--line); }
button.quiet:hover { border-color: var(--gold); color: var(--gold); background: transparent; }
button.live { border-color: var(--err); color: var(--err); background: transparent; }
button:disabled { opacity: 0.4; cursor: default; }
a { color: var(--gold); }
.note { font-size: 14px; color: var(--muted); max-width: 62ch; }
.note.err { color: var(--err); }
.note strong { color: var(--text); font-weight: 500; }
.how { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); max-width: 60ch; }
.how strong { color: var(--text); font-weight: 500; }
.hint { font-size: 12px; color: var(--muted); }

.doc { border-top: 1px solid var(--gold-dim); padding-top: 24px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.doc h2 { font-family: var(--display); font-size: 34px; font-weight: 600; line-height: 1.1; margin: 0; }
.doc h3 { font-family: var(--display); font-size: 24px; font-weight: 600; color: var(--gold); margin: 16px 0 0; line-height: 1.2; }
.doc h4 { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 8px 0 0; }
.doc p, .doc ul { margin: 0; max-width: 65ch; overflow-wrap: anywhere; }
.doc ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.doc strong { font-weight: 600; }
footer { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Links that act as buttons, and the form on the landing page. */
a.btn {
  display: inline-block; text-decoration: none; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--gold); background: var(--gold); color: var(--ink); padding: 12px 18px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
a.btn:hover { background: var(--text); border-color: var(--text); }
a.btn.quiet { background: transparent; color: var(--text); border-color: var(--line); }
a.btn.quiet:hover { border-color: var(--gold); color: var(--gold); background: transparent; }
[hidden] { display: none !important; }
