:root {
  --paper: #f6f3ee;
  --ink: #2b2724;
  --soft: #8a8178;
  --line: #ddd6cc;
  --accent: #8c3b2e;
  --font: 'LXGW WenKai', 'Kaiti SC', 'STKaiti', serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 19px/2 var(--font);
  -webkit-font-smoothing: antialiased;
}
.page { max-width: 480px; margin: 0 auto; padding: 18vh 24px 96px; }
p { margin: 0; }

.note { animation: in 1.2s ease both; }
.to { margin-bottom: 1.2em; }
.text { white-space: pre-line; }
.from { margin-top: 2.4em; color: var(--soft); }

.reply { margin-top: 72px; padding-top: 40px; border-top: 1px solid var(--line); animation: in 1.2s ease .3s both; }
form { display: grid; gap: 28px; }
.if-coming { display: grid; gap: 28px; }
.field { display: grid; gap: 8px; }
.field > span { color: var(--soft); font-size: .9em; }

input:not([type=radio]) {
  font: inherit; color: inherit; width: 100%;
  background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  padding: 2px 0 6px;
}
input:not([type=radio]):focus { outline: none; border-bottom-color: var(--ink); }
input::placeholder { color: #bcb3a8; }

.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choices label { cursor: pointer; }
.choices input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choices b {
  display: inline-block; font-weight: 400; min-width: 2.6em; text-align: center;
  padding: 2px 16px; border: 1px solid var(--line); border-radius: 999px;
  transition: background .2s, color .2s, border-color .2s;
}
.choices label:hover b { border-color: var(--soft); }
.choices input:checked + b { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.choices input:focus-visible + b { outline: 2px solid var(--accent); outline-offset: 2px; }

button {
  font: inherit; cursor: pointer;
}
#submit-btn {
  justify-self: start; margin-top: 8px;
  padding: 6px 30px; border-radius: 999px;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
  transition: opacity .2s;
}
#submit-btn:hover { opacity: .85; }
#submit-btn:disabled { opacity: .5; cursor: wait; }
.error { color: var(--accent); }
.hp { position: absolute; left: -9999px; }

.done { animation: in .8s ease both; }
.again { margin-top: 12px; padding: 0; background: none; border: 0; color: var(--soft); text-decoration: underline; text-underline-offset: 4px; }

@keyframes in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .note, .reply, .done { animation: none; } }
@media (max-width: 480px) { body { font-size: 18px; } .page { padding-top: 12vh; } }
