:root {
  --ink: #1a1410;
  --paper: #f3ead6;
  --line: #c9b89a;
  --red: #b42318;
  --muted: #7a6b55;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: #2a231c;
  color: var(--ink);
  font-family: "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif;
}
.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  background: #efe4cc;
  display: flex;
  flex-direction: column;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px;
}
.brand { display: flex; gap: 10px; align-items: center; }
.brand h1 { margin: 0; font-size: 20px; letter-spacing: 0.2em; font-weight: 600; }
.brand p { margin: 2px 0 0; font-size: 11px; color: var(--muted); letter-spacing: 0.12em; }
.seal-mini {
  width: 36px; height: 36px;
  border: 2px solid var(--red);
  color: var(--red);
  display: grid; place-items: center;
  font-size: 18px;
  transform: rotate(-8deg);
}
.ghost {
  background: transparent;
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--ink);
}
.stage-wrap {
  position: relative;
  margin: 0 16px;
  background: #d9cbb0;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  box-shadow: 0 10px 28px rgba(40, 24, 8, 0.18);
}
#stage {
  width: 100%;
  height: 100%;
  display: block;
}
.loading {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(243, 234, 214, 0.72);
  letter-spacing: 0.3em;
  color: var(--muted);
}
.loading.hide { display: none; }
.panel {
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field span, .slider span, .check span { font-size: 12px; color: var(--muted); letter-spacing: 0.16em; }
.field input[type="text"] {
  width: 100%;
  font-size: 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #f7f1e3;
  border-radius: 6px;
  outline: none;
}
.row { display: flex; gap: 8px; }
.seg {
  flex: 1;
  display: flex;
  background: #e7dcc4;
  border-radius: 8px;
  padding: 3px;
}
.seg button {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 8px 0;
  font-size: 13px;
  color: #5c4e3a;
  border-radius: 6px;
}
.seg button.on {
  background: #2c241c;
  color: #f3ead6;
}
.seg-wide button {
  font-size: 12px;
  padding: 8px 2px;
}
.slider { display: flex; align-items: center; gap: 10px; }
.slider input { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.actions { display: flex; gap: 8px; }
.primary, .secondary {
  flex: 1;
  border: 0;
  padding: 12px;
  border-radius: 8px;
  font-size: 15px;
  letter-spacing: 0.12em;
}
.primary { background: #1d1712; color: #f3ead6; }
.secondary { background: #8a6a4a; color: #fff; }
.pay {
  width: 100%;
  border: 0;
  padding: 13px;
  border-radius: 8px;
  font-size: 16px;
  letter-spacing: 0.08em;
  background: #c24a3a;
  color: #fff;
}
.hint { margin: 2px 0 0; font-size: 11px; color: var(--muted); line-height: 1.5; }
.legal {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  justify-content: center;
  padding: 8px 16px 28px;
  font-size: 12px;
}
.legal a { color: var(--muted); }
.hint.muted { opacity: 0.75; }
button { font-family: inherit; }
