/* A continuous sheet of paper, reserved for the naming ceremony. */
body { transition: background-color 1000ms ease; }
body.naming-paper-mode { background-color: #f2f0ea; }
.name-shell { transition: background-color 1000ms ease; }
.naming-paper-mode .name-shell {
  background-color: #f2f0ea;
  background-image: none;
}
.naming-review { transform-origin: 12% 50%; }
.naming-review.is-turning { animation: naming-turn 720ms cubic-bezier(.22,.61,.36,1) both; pointer-events: none; }
@keyframes naming-turn {
  to { opacity: 0; transform: perspective(1200px) rotateY(-5deg) translateY(-8px); }
}
#naming-results { padding: 0 30px 100px; }
#naming-results > .naming-paper { width: min(100%, 760px); padding: 0; border: 0; background: none; box-shadow: none; }
.naming-paper > .text-back { position: absolute; top: 24px; left: 0; z-index: 2; margin: 0; }
/* A flat horizontal mounting: paper, narrow borders, side mounts and wood rollers. */
.naming-paper-hero { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100svh - var(--fc-header-height, 64px) - 56px); padding: 90px 0 120px; text-align: center; }
.naming-scroll { position: relative; width: min(90%, 620px); height: 300px; flex: 0 0 auto; }
.naming-scroll-sheet { position: absolute; inset: 0 5px; background: #b9afa0; clip-path: inset(0 calc(50% - 5px)); transition: clip-path 1250ms cubic-bezier(.25,.65,.25,1); }
.naming-scroll-paper { position: absolute; inset: 10% 9%; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 28px 10px 24px; border: 7px solid #dcd3c2; outline: 1px solid #9c907b; outline-offset: 3px; background: #f8f3e8; }
.naming-scroll-paper::before, .naming-scroll-paper::after { content: ''; position: absolute; top: -7px; bottom: -7px; width: 1px; background: #b6a891; }
.naming-scroll-paper::before { left: -12px; }
.naming-scroll-paper::after { right: -12px; }
.naming-scroll-roller { position: absolute; top: -7px; bottom: -7px; width: 50%; pointer-events: none; transition: transform 1250ms cubic-bezier(.25,.65,.25,1); }
.naming-scroll-roller--left { left: 0; transform: translateX(100%); }
.naming-scroll-roller--right { right: 0; transform: translateX(-100%); }
.naming-scroll-roller i { position: absolute; top: 0; bottom: 0; width: 11px; border-radius: 1px; border: 1px solid #574335; background: linear-gradient(90deg,#68513f 0 18%,#826a54 18% 68%,#705843 68%); }
.naming-scroll-roller--left i { left: 0; }
.naming-scroll-roller--right i { right: 0; }
.naming-scroll-roller i::before, .naming-scroll-roller i::after { content: ''; position: absolute; left: -3px; width: 15px; height: 9px; border-radius: 1px; border: 1px solid #574335; background: #68513f; }
.naming-scroll-roller i::before { top: -5px; }
.naming-scroll-roller i::after { bottom: -5px; }
.naming-scroll.is-open .naming-scroll-sheet { clip-path: inset(0); }
.naming-scroll.is-open .naming-scroll-roller { transform: translateX(0); }
.naming-scroll.is-instant .naming-scroll-sheet, .naming-scroll.is-instant .naming-scroll-roller { transition: none; }
.naming-ink { display: flex; align-items: center; justify-content: center; width: 78%; max-width: 360px; gap: clamp(7px, 1.5vw, 20px); min-height: 0; }
.naming-ink-character { display: block; width: min(28%, 104px); aspect-ratio: 1; min-width: 0; flex: 0 1 104px; color: #000; font-family: KaiTi, STKaiti, '楷体', var(--serif); font-size: clamp(28px, 7vw, 82px); line-height: 1; }
.naming-ink:has(> :nth-child(4)) { width: 80%; }
.naming-ink-character svg { display: block; width: 100%; height: 100%; overflow: visible; }
.naming-ink-character.is-fallback { display: grid; place-items: center; }
.naming-scroll-caption { margin: 22px 0 0; padding-top: 16px; position: relative; width: 90%; flex: 0 0 auto; display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; opacity: 0; transition: opacity 900ms ease; }
.naming-scroll-caption::before { content: ''; position: absolute; top: 0; left: calc(50% - 10px); height: 1px; width: 20px; background: #c5b9a5; }
.naming-scroll-caption span { font-size: 10px; line-height: 1.8; letter-spacing: .14em; color: #7d7260; }
.naming-scroll-seal { position: absolute; right: 16px; bottom: 15px; width: 17px; padding: 2px; border: 1px solid #a75b47; color: #a75b47; font-size: 10px; line-height: 1.1; opacity: 0; transition: opacity 600ms ease; }
.naming-scroll.is-written .naming-scroll-seal { opacity: .8; }
.naming-scroll.is-written .naming-scroll-caption { opacity: 1; }
.naming-paper-status { min-height: 24px; margin: 38px 0 0; color: var(--muted); font-size: 11px; letter-spacing: .16em; }
#namingPaperStatus[hidden] { display: block !important; visibility: hidden; }
.naming-paper-reading { position: absolute; bottom: -34px; width: 100%; margin: 0; color: var(--muted); font-size: 10px; letter-spacing: .14em; }
.naming-skip, .naming-read { border: 0; background: none; color: var(--muted); min-height: 44px; padding: 10px 16px; font-size: 11px; letter-spacing: .16em; }
.naming-skip { position: absolute; bottom: 44px; }
.naming-read { position: absolute; bottom: 24px; display: flex; flex-direction: column; align-items: center; gap: 13px; }
.naming-read > svg { color: var(--gold); width: 20px; height: 20px; }
.naming-paper-options { padding: 20px 0 42px; text-align: center; }
.naming-paper-options > span { color: var(--gold); font-size: 10px; letter-spacing: .22em; }
.naming-paper-options .name-options { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 28px; margin: 22px 0 0; border: 0; }
.naming-paper-options .name-option { display: block; flex: 0 1 auto; width: auto; min-height: 44px; padding: 10px 4px; border: 0; border-bottom: 1px solid transparent; background: none; box-shadow: none; color: var(--muted); }
.naming-paper-options .name-option[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--gold); }
.naming-paper-options .name-option:hover { padding: 10px 4px; color: var(--ink); background: none; }
.naming-paper-options .name-option strong { font-size: 19px; font-weight: 400; letter-spacing: .14em; }
#naming-choice > .naming-choice-sheet { width: min(100%,680px); border: 0; background: none; box-shadow: none; padding: 10px 12px 50px; }
.naming-choice-heading { padding: 24px 0 16px; text-align: center; }
.naming-choice-heading h1 { font-size: 25px; font-weight: 400; }
.naming-choice-heading > p:last-child { color: var(--muted); font-size: 12px; }
.naming-choice-sheet .name-options { border: 0; margin-top: 20px; }
.naming-choice-sheet .name-option { display: flex; flex-direction: column; gap: 8px; padding: 24px 20px; margin: 0 0 16px; border: 1px solid var(--line); text-align: center; background: rgba(250,247,240,.5); }
.naming-choice-sheet .name-option:hover, .naming-choice-sheet .name-option:focus-visible { border-color: var(--gold); background: #f8f5ee; }
.naming-choice-sheet .name-option strong { font-size: 31px; font-weight: 400; letter-spacing: .2em; }
.name-option-reading { color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.naming-choice-sheet .name-option p { margin: 4px 0 8px; font-size: 12px; line-height: 1.9; color: var(--muted); }
.name-option-select { font-size: 11px; color: #8e624c; letter-spacing: .12em; }
.naming-choice-footnote { margin-top: 28px; text-align: center; color: var(--muted); font-size: 10px; }
.naming-annotations { width: min(100%, 580px); margin: 0 auto; padding: 30px 0 60px; scroll-margin-top: 90px; }
.naming-annotation { padding: 38px 0; }
.naming-annotation + .naming-annotation { border-top: 1px solid var(--hair); }
.naming-annotation h2 { margin: 0 0 26px; font-size: 12px; font-weight: 400; letter-spacing: .24em; color: var(--gold); }
.naming-annotation > p, .naming-annotation > div > p { margin: 0; font-size: 17px; line-height: 2.35; }
.naming-annotation .word-pair { display: block; }
.naming-annotation .word-card { padding: 24px 0; border: 0; background: none; }
.naming-annotation .word-card + .word-card { margin-top: 22px; }
.naming-annotation .word-card__head strong { font-size: 42px; font-weight: 400; }
.naming-annotation .word-card__meaning { font-size: 15px !important; line-height: 2.2 !important; }
.naming-annotation .word-card__facts { opacity: .9; }
.naming-annotation .word-card__facts dt, .naming-annotation .word-card__facts dd { font-size: 11px; }
.naming-annotation details { margin-top: 18px; color: var(--muted); }
.naming-annotation summary { width: fit-content; min-height: 44px; padding: 12px 0; cursor: pointer; font-size: 11px; letter-spacing: .14em; }
.naming-annotation .naming-score-line { justify-content: flex-start; flex-wrap: wrap; margin-top: 28px; font-size: 11px; }
.naming-annotation .naming-score-line strong { font-size: 16px; font-weight: 400; }
.naming-annotation.is-awaiting { opacity: 0; transform: translateY(14px); }
.naming-annotation { transition: opacity 900ms ease, transform 900ms cubic-bezier(.22,.61,.36,1); }
.naming-paper-reading, .naming-read, #namingAfterword { animation: naming-settle 1100ms ease both; }
@keyframes naming-settle { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 600px) {
  #naming-results { padding-inline: 22px; }
  .naming-paper-hero { min-height: calc(100svh - var(--fc-header-height, 64px) - 128px); padding: 80px 0 96px; }
  .naming-scroll { width: 92%; height: clamp(190px, 28svh, 236px); }
  .naming-scroll-paper { inset: 10% 8%; padding: 20px 5px 24px; border-width: 5px; outline-offset: 2px; }
  .naming-scroll-paper::before { left: -9px; top: -5px; bottom: -5px; }
  .naming-scroll-paper::after { right: -9px; top: -5px; bottom: -5px; }
  .naming-scroll-caption { margin-top: 16px; padding-top: 12px; gap: 3px 10px; }
  .naming-scroll-caption span { font-size: 9px; letter-spacing: .04em; }
  .naming-scroll-seal { right: 9px; bottom: 9px; width: 14px; padding: 1px; font-size: 9px; }
  .naming-paper-options .name-options { gap: 8px 18px; }
  .naming-paper-options .name-option strong { font-size: 17px; }
  .naming-annotation > p, .naming-annotation > div > p { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  body, .name-shell { transition: none; }
  .naming-review.is-turning, .naming-paper-reading, .naming-read, #namingAfterword { animation: none; }
  .naming-annotation { transition: none; }
  .naming-scroll-sheet, .naming-scroll-roller, .naming-scroll-seal, .naming-scroll-caption { transition: none; }
}
@media print {
  .naming-paper > .text-back, .naming-read, .naming-skip, .naming-paper-options { display: none !important; }
  .naming-paper-hero { min-height: 0; padding: 35px 0; }
  .naming-scroll-sheet { clip-path: none; }
  .naming-scroll-roller { transform: none; }
  .naming-annotation.is-awaiting { opacity: 1; transform: none; }
}
