:root {
  --night: #140e0b;
  --paper: #f2e3c2;
  --paper-edge: #dcc497;
  --ink: #1c1510;
  --ink-soft: #5b4a39;
  --red: #b3261e;
  --gold: #d6a84a;
  --wood: #5c3218;
  --W: min(calc(100vw - 24px), 980px);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 50% 40%, rgba(179, 38, 30, 0.28), transparent 65%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 46px),
    var(--night);
  font-family: 'Gowun Batang', 'Noto Serif KR', serif;
  -webkit-tap-highlight-color: transparent;
}

body.shake { animation: shake 0.45s linear; }

@keyframes shake {
  0%, 100% { transform: none; }
  15% { transform: translate(-7px, 4px); }
  30% { transform: translate(6px, -5px); }
  45% { transform: translate(-5px, -3px); }
  60% { transform: translate(4px, 5px); }
  80% { transform: translate(-2px, 2px); }
}

/* ---------- 입장 ---------- */

.intro {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #000;
  color: #f4e6c8;
  transition: opacity 0.6s ease;
}
.intro.gone { opacity: 0; pointer-events: none; }

.drum, .herald, .rays {
  grid-area: 1 / 1;
  margin: 0;
  text-align: center;
  opacity: 0;
}
.drum {
  font: 900 clamp(70px, 24vw, 150px) 'Noto Serif KR', serif;
  animation: drum 0.6s ease-out forwards;
}
.d1 { animation-delay: 0.3s; }
.d2 { animation-delay: 0.95s; font-size: clamp(90px, 30vw, 190px); }
.d3 { animation-delay: 1.6s; font-size: clamp(170px, 58vw, 360px); color: var(--red); text-shadow: 0 0 40px rgba(179, 38, 30, 0.7); }

@keyframes drum {
  0% { opacity: 0; transform: scale(2.2); }
  25% { opacity: 1; transform: scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: scale(0.92); }
}

/* 뒤에서 도는 금빛 햇살 */
.rays {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: 170vmax;
  height: 170vmax;
  background: repeating-conic-gradient(from 0deg, rgba(214, 168, 74, 0.22) 0 7deg, transparent 7deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 10%, transparent 60%);
  mask: radial-gradient(circle, #000 10%, transparent 60%);
  animation: rays-in 0.3s ease 2.2s forwards, spin 7s linear 2.2s infinite;
}
@keyframes rays-in { to { opacity: 1; } }
@keyframes spin { to { rotate: 360deg; } }

.herald {
  position: relative;
  opacity: 1;
  font: 900 clamp(58px, 19vw, 150px) 'Noto Serif KR', serif;
  line-height: 1.08;
  letter-spacing: -0.02em;
  animation: herald-grow 2.2s linear 2.2s forwards;
}
.herald span {
  display: block;
  opacity: 0;
  color: #ffd76a;
  background: linear-gradient(180deg, #fff3c4 0%, #ffd25a 45%, #c8861e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 2px #7a1410;
  filter: drop-shadow(0 6px 0 #5c0d09) drop-shadow(0 0 26px rgba(255, 190, 70, 0.6));
}
.herald .h1 { animation: slam 0.32s cubic-bezier(0.2, 1.5, 0.4, 1) 2.2s forwards, jitter 0.11s steps(2) 2.55s infinite; }
.herald .h2 {
  font-size: 1.22em;
  animation: slam 0.32s cubic-bezier(0.2, 1.5, 0.4, 1) 2.55s forwards, jitter 0.13s steps(2) 2.9s infinite;
}
@keyframes slam {
  0% { opacity: 0; transform: scale(3.4) rotate(-10deg); }
  100% { opacity: 1; transform: scale(1) rotate(-4deg); }
}
@keyframes jitter {
  0% { opacity: 1; transform: translate(-2px, 1px) rotate(-4.5deg); }
  50% { opacity: 1; transform: translate(2px, -2px) rotate(-3.5deg); }
  100% { opacity: 1; transform: translate(-1px, 2px) rotate(-4deg); }
}
@keyframes herald-grow {
  from { transform: scale(1); }
  to { transform: scale(1.22); }
}

.intro.rumble { animation: rumble 0.16s linear infinite; }
@keyframes rumble {
  0%, 100% { transform: none; }
  25% { transform: translate(-4px, 3px); }
  50% { transform: translate(4px, -2px); }
  75% { transform: translate(-3px, -3px); }
}
.intro.gone {
  animation: none;
  transform: scale(1.8);
  transition: opacity 0.5s ease, transform 0.5s ease-in;
}

.intro-skip {
  position: absolute;
  bottom: calc(24px + env(safe-area-inset-bottom));
  margin: 0;
  font-size: 12px;
  color: rgba(244, 230, 200, 0.4);
}

/* ---------- 무대 ---------- */

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh;
  height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
}

/* 단청 띠 */
.dancheong {
  flex: none;
  width: 100%;
  height: 22px;
  background:
    linear-gradient(to bottom, transparent 0 15px, #1d6b52 15px 18px, #c9a23a 18px 22px),
    repeating-linear-gradient(90deg,
      #1d6b52 0 10px, #e8d7a8 10px 13px, #b3261e 13px 25px, #e8d7a8 25px 28px,
      #26508a 28px 38px, #e8d7a8 38px 41px, #b3261e 41px 53px, #e8d7a8 53px 56px);
}
.dancheong.bottom { transform: scaleY(-1); margin-top: auto; }

/* ---------- 두루마리 ---------- */

.scroll {
  position: relative;
  flex: 1 1 auto;
  width: 44px;
  max-height: 640px;
  margin: 22px 0 10px;
  transition: width 1.5s cubic-bezier(0.6, 0, 0.2, 1);
}
.scroll.unrolled { width: var(--W); }

.roller {
  position: absolute;
  top: -14px;
  bottom: -14px;
  z-index: 2;
  width: 20px;
  border-radius: 10px;
  background: linear-gradient(90deg, #2e170a, var(--wood) 30%, #8a5530 55%, var(--wood) 80%, #2e170a);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}
.roller::before, .roller::after {
  content: '';
  position: absolute;
  left: -3px;
  right: -3px;
  height: 16px;
  border-radius: 5px;
  background: linear-gradient(90deg, #7a5a1c, var(--gold), #7a5a1c);
}
.roller::before { top: 0; }
.roller::after { bottom: 0; }
.roller-r { right: 0; }
.roller-l { left: 0; }

.paper {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 12px;
  right: 12px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.5), transparent 60%),
    repeating-linear-gradient(97deg, rgba(110, 80, 30, 0.04) 0 1px, transparent 1px 6px),
    linear-gradient(90deg, var(--paper-edge), var(--paper) 4%, var(--paper) 96%, var(--paper-edge));
  box-shadow: inset 0 0 40px rgba(120, 80, 30, 0.25);
}

/* 펼쳐지는 동안 글은 제자리에 두고 가운데부터 드러낸다 */
.text {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: calc(var(--W) - 24px);
  transform: translateX(-50%);
  overflow-x: auto;
  overflow-y: hidden;
  writing-mode: vertical-rl;
  padding: 26px 14px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.text::-webkit-scrollbar { display: none; }

.title-col {
  flex: none;
  padding-inline: 4px;
  margin-inline-start: 0;
  padding-block: 0 14px;
  margin-block-end: 6px;
  border-block-end: 2px solid var(--red);
}
.title-col .kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.25em;
  color: var(--red);
}
.title {
  display: flex;
  align-items: center;
  margin: 0;
  padding-block: 8px;
}
.title b {
  font: 900 clamp(46px, 7.4vh, 66px) 'Noto Serif KR', serif;
  line-height: 1.08;
}
/* 세로 한자 밑에 한글 제목을 가로로 */
.title-ko {
  writing-mode: horizontal-tb;
  margin-block-start: 10px;
  font: 700 16px 'Gowun Batang', serif;
  letter-spacing: 0.15em;
  padding-inline-start: 0.15em;
  color: var(--red);
  white-space: nowrap;
  position: relative;
  padding: 4px 8px 4px calc(8px + 0.15em);
}
/* 왼쪽 위·오른쪽 아래 꺾쇠 */
.title-ko::before, .title-ko::after {
  content: '';
  position: absolute;
  width: 9px;
  height: 9px;
  border: 0 solid var(--red);
}
.title-ko::before { left: 0; top: 0; border-top-width: 2px; border-left-width: 2px; }
.title-ko::after { right: 0; bottom: 0; border-bottom-width: 2px; border-right-width: 2px; }
.title-col .sub {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
}

/* ---------- 한 줄 ---------- */

.verse {
  border-block-start: 1px solid rgba(28, 21, 16, 0.12);
}
.title-col + .verse { border-block-start: 0; }

.line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-block: 10px 6px;
  cursor: pointer;
  outline: none;
}
.line:focus-visible .han { color: var(--red); }

.num {
  font: 700 12px 'Noto Serif KR', serif;
  color: var(--red);
}

.han {
  display: flex;
  gap: 0.55em;
  font: 900 clamp(26px, 4.3vh, 36px) 'Noto Serif KR', serif;
  line-height: 1.15;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.han ruby { ruby-align: space-around; }
.han rt {
  font: 700 clamp(15px, 2.3vh, 19px) 'Gowun Batang', serif;
  letter-spacing: 0.04em;
  color: #8f1d15;
  padding-inline-start: 2px;
}

/* 풀이: 세로쓰기에서는 행 방향이 가로라 grid 행을 늘리면 옆으로 펼쳐진다 */
.gloss {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s cubic-bezier(0.3, 0.7, 0.2, 1);
}
.gloss > div { overflow: hidden; }
.gloss-in {
  margin-block: 8px 6px;
  margin-inline: 4px 2px;
  padding: 10px 6px;
  border-block-start: 3px solid var(--red);
  background: rgba(179, 38, 30, 0.07);
  opacity: 0;
  filter: blur(5px);
  transition: opacity 0.45s ease 0.1s, filter 0.45s ease 0.1s;
}
.gloss-head {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 4px;
  padding-block-start: 2px;
  font: 700 11px 'Gowun Batang', serif;
  letter-spacing: 0.2em;
  color: var(--red);
  white-space: nowrap;
}
.gloss-head b {
  padding: 4px 2px;
  border-radius: 2px;
  background: var(--red);
  color: #fbecd2;
  font: 900 12px 'Noto Serif KR', serif;
  letter-spacing: 0;
}
.gl {
  margin: 0;
  margin-block-start: 2px;
  font-size: clamp(14px, 2.1vh, 17px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.03em;
  color: var(--ink);
  white-space: nowrap;
}
.src {
  display: inline-block;
  margin-inline-end: 8px;
  padding: 4px 1px;
  border: 1px solid var(--red);
  border-radius: 2px;
  font: 700 11px 'Noto Serif KR', serif;
  letter-spacing: 0.05em;
  color: var(--red);
  background: rgba(255, 250, 238, 0.7);
}
.verse.open .gloss { grid-template-rows: 1fr; }
.verse.open .gloss-in { opacity: 1; filter: none; }
.verse.open .line { background: rgba(179, 38, 30, 0.05); }
.verse.now .line { animation: now 0.9s ease; }
@keyframes now {
  0%, 40% { background: rgba(214, 168, 74, 0.35); }
}

/* ---------- 족자 두 폭 ---------- */

.gallery {
  --jw: min(170px, 17vh, calc((var(--W) - 120px) / 2));
  writing-mode: horizontal-tb;
  display: flex;
  flex-direction: row-reverse; /* 오른쪽부터 읽는 순서 */
  align-items: center;
  justify-content: center;
  gap: 26px;
  width: calc(var(--jw) * 2 + 66px);
  height: 100%;
  padding: 0 10px;
  border-left: 1px solid rgba(28, 21, 16, 0.12);
}

.jokja {
  position: relative;
  flex: none;
  width: var(--jw);
  margin: 0;
  transform-origin: 50% -30px;
  animation: sway 5s ease-in-out infinite;
}
.jokja:nth-child(2) { animation-delay: -2.5s; }
@keyframes sway {
  0%, 100% { transform: rotate(-1deg); }
  50% { transform: rotate(1deg); }
}
/* 거는 끈 (∧) */
.jokja::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -24px;
  width: 44px;
  height: 24px;
  translate: -50% 0;
  background:
    linear-gradient(to top right, transparent calc(50% - 1px), #6b4a22 calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) left / 50% 100% no-repeat,
    linear-gradient(to top left, transparent calc(50% - 1px), #6b4a22 calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) right / 50% 100% no-repeat;
}

.rod {
  display: block;
  position: relative;
  height: 12px;
  margin: 0 -7px;
  border-radius: 6px;
  background: linear-gradient(180deg, #8a5530, var(--wood) 60%, #2e170a);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35);
}
.rod::before, .rod::after {
  content: '';
  position: absolute;
  top: -2px;
  width: 10px;
  height: 16px;
  border-radius: 3px;
  background: linear-gradient(90deg, #7a5a1c, var(--gold), #7a5a1c);
}
.rod::before { left: -6px; }
.rod::after { right: -6px; }

/* 비단 표구 */
.silk {
  position: relative;
  padding: 12px 10px 10px;
  background:
    repeating-linear-gradient(45deg, rgba(214, 168, 74, 0.12) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(-45deg, rgba(214, 168, 74, 0.12) 0 2px, transparent 2px 9px),
    #24414c;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.pic {
  display: block;
  width: 100%;
  padding: 5px;
  border: 0;
  background: #efe0bd;
  cursor: zoom-in;
}
.pic img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  filter: sepia(0.18) saturate(0.95);
}

.jokja figcaption {
  margin-top: 8px;
  text-align: center;
  color: #f4e6c8;
}
.jokja figcaption b {
  display: block;
  font: 900 18px 'Noto Serif KR', serif;
  letter-spacing: 0.2em;
  padding-left: 0.2em;
}
.jokja figcaption span {
  display: block;
  margin-top: 2px;
  font: 700 11px 'Gowun Batang', serif;
  white-space: nowrap;
  opacity: 0.8;
}

.nakgwan {
  position: absolute;
  right: 10px;
  bottom: 76px;
  writing-mode: vertical-rl;
  padding: 3px 2px;
  border-radius: 2px;
  background: var(--red);
  color: #fbecd2;
  font: 900 10px 'Noto Serif KR', serif;
  letter-spacing: 0.05em;
  transform: rotate(-4deg);
  box-shadow: inset 0 0 0 1px rgba(251, 236, 210, 0.5);
  pointer-events: none;
}

/* 크게 보기 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(10, 6, 4, 0.92);
  animation: fade-in 0.25s ease;
}
.lightbox[hidden] { display: none; }
.lightbox figure {
  margin: 0;
  padding: 10px 10px 12px;
  background: #24414c;
  border-top: 10px solid var(--wood);
  border-bottom: 10px solid var(--wood);
  text-align: center;
}
.lightbox img {
  display: block;
  max-width: min(88vw, 560px);
  max-height: 72vh;
  border: 5px solid #efe0bd;
}
.lightbox figcaption {
  margin-top: 10px;
  font: 700 15px 'Noto Serif KR', serif;
  color: #f4e6c8;
}
.lb-close {
  position: absolute;
  bottom: calc(16px + env(safe-area-inset-bottom));
  margin: 0;
  font-size: 12px;
  color: rgba(244, 230, 200, 0.5);
}

/* ---------- 끝 ---------- */

.end-col {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-block: 12px 30px;
  border-block-start: 2px solid var(--red);
}
.sign {
  margin: 0;
  font: 700 20px 'Noto Serif KR', serif;
  letter-spacing: 0.25em;
  flex: none;
  white-space: nowrap;
}
.bow {
  writing-mode: vertical-rl;
  padding: 18px 12px;
  border: 0;
  border-radius: 3px;
  background: var(--red);
  color: #fbecd2;
  font: 900 20px 'Noto Serif KR', serif;
  letter-spacing: 0.08em;
  box-shadow: 0 4px 0 #6d1510;
  cursor: pointer;
}
.bow small {
  display: block;
  margin-block-start: 8px;
  font: 700 11px 'Gowun Batang', serif;
  letter-spacing: 0.2em;
  opacity: 0.8;
}
.bow:active { transform: translateX(2px); box-shadow: 0 2px 0 #6d1510; }

.tally {
  writing-mode: horizontal-tb;
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.tally b, .cry-count b {
  font: 900 1.4em 'Noto Serif KR', serif;
  color: var(--red);
}

/* ---------- 큰절 버튼을 누르고 싶게 ---------- */

.bow-wrap { position: relative; flex: none; }
.bow-wrap.hey { animation: hey 0.8s ease; }
@keyframes hey {
  15% { transform: rotate(-6deg) scale(1.08); }
  35% { transform: rotate(5deg) scale(1.1); }
  55% { transform: rotate(-3deg) scale(1.05); }
  75% { transform: rotate(2deg); }
}

.bow {
  position: relative;
  overflow: hidden;
  animation: bow-glow 1.6s ease-in-out infinite;
}
@keyframes bow-glow {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 0 #6d1510, 0 0 0 0 rgba(255, 200, 90, 0); }
  50% { transform: scale(1.05); box-shadow: 0 4px 0 #6d1510, 0 0 24px 6px rgba(255, 200, 90, 0.7); }
}
/* 위에서 아래로 훑는 빛 */
.bow::after {
  content: '';
  position: absolute;
  left: -10%;
  right: -10%;
  top: -60%;
  height: 45%;
  background: linear-gradient(to bottom, transparent, rgba(255, 238, 190, 0.55), transparent);
  transform: skewY(-12deg);
  animation: shine 2.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shine {
  0% { top: -60%; }
  55%, 100% { top: 130%; }
}
.bow:active { animation: none; transform: translateY(3px); box-shadow: 0 1px 0 #6d1510; }

.spark {
  position: absolute;
  font-style: normal;
  font-size: 15px;
  color: #e6b54a;
  text-shadow: 0 0 8px rgba(255, 210, 110, 0.9);
  pointer-events: none;
  animation: twinkle 1.8s ease-in-out infinite;
}
.s1 { top: -12px; right: -14px; }
.s2 { top: 38%; left: -18px; font-size: 12px; animation-delay: 0.5s; }
.s3 { bottom: 16px; right: -16px; font-size: 13px; animation-delay: 0.9s; }
.s4 { bottom: -12px; left: -8px; font-size: 11px; animation-delay: 1.3s; }
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.4) rotate(0); }
  50% { opacity: 1; transform: scale(1.2) rotate(45deg); }
}

/* ---------- 아래 조작 ---------- */

.controls {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 4px 16px 16px;
  opacity: 0;
  transition: opacity 0.6s ease 1.2s;
}
.scroll.unrolled + .controls { opacity: 1; }

.hint {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(244, 230, 200, 0.6);
  animation: nudge 1.6s ease-in-out infinite;
}
@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-8px); }
}

.seal {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 20px 6px 6px;
  border: 1px solid rgba(214, 168, 74, 0.5);
  border-radius: 4px;
  background: #241912;
  color: #f4e6c8;
  font: 700 15px 'Gowun Batang', serif;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.seal-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 3px;
  background: var(--red);
  color: #fbecd2;
  font: 900 25px 'Noto Serif KR', serif;
  box-shadow: inset 0 0 0 2px rgba(251, 236, 210, 0.5);
}
.seal:active .seal-mark { transform: scale(0.9); }

/* ---------- 옥새 쾅 ---------- */

.stamp {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
}
.stamp span {
  display: grid;
  place-items: center;
  width: min(56vw, 260px);
  aspect-ratio: 1;
  border: 8px double rgba(251, 236, 210, 0.7);
  border-radius: 10px;
  background: rgba(179, 38, 30, 0.93);
  color: #fbecd2;
  font: 900 min(36vw, 170px) 'Noto Serif KR', serif;
  transform: rotate(-8deg);
}
.stamp.on { animation: stamp 1.6s ease forwards; }
@keyframes stamp {
  0% { opacity: 0; transform: scale(3); }
  18% { opacity: 1; transform: scale(1); }
  70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.1); }
}

.chorus {
  position: fixed;
  left: 0;
  right: 0;
  top: calc(50% + min(28vw, 130px) + 24px);
  z-index: 16;
  margin: 0;
  text-align: center;
  font: 400 clamp(36px, 11vw, 64px) 'Nanum Brush Script', cursive;
  color: var(--gold);
  text-shadow: 0 2px 0 #000, 0 0 24px #000;
  pointer-events: none;
  opacity: 0;
}
.chorus.on { animation: chorus 2s ease forwards; }
@keyframes chorus {
  0% { opacity: 0; transform: translateY(16px); }
  20%, 75% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-10px); }
}

/* ---------- 큰절 뒤: 조정 ---------- */

.court {
  position: fixed;
  inset: 0;
  z-index: 6; /* kit 꽃가루(8) 아래 */
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(10, 6, 4, 0.94);
  animation: fade-in 0.35s ease;
}
.court[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } }

.army {
  position: absolute;
  inset: -20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  align-content: center;
  gap: 10px 0;
  font-size: 36px;
  text-align: center;
  opacity: 0.3;
}
.army i {
  font-style: normal;
  animation: kowtow 0.9s ease-in-out var(--d) infinite;
}
@keyframes kowtow {
  0%, 100% { transform: translateY(0) rotate(0); }
  45% { transform: translateY(8px) rotate(16deg) scale(0.92); }
}

.cry {
  position: relative;
  margin: 0;
  text-align: center;
  font: 900 clamp(46px, 14vw, 110px) 'Noto Serif KR', serif;
  line-height: 1.1;
  color: #ffd76a;
  -webkit-text-stroke: 2px #7a1410;
  filter: drop-shadow(0 5px 0 #5c0d09) drop-shadow(0 0 22px rgba(255, 190, 70, 0.55));
  animation: slam 0.35s cubic-bezier(0.2, 1.5, 0.4, 1) both, jitter 0.12s steps(2) 0.4s infinite;
}
.cry-wrap {
  position: relative;
  padding: 36px 12px;
  background: radial-gradient(ellipse at center, rgba(10, 6, 4, 0.92) 35%, rgba(10, 6, 4, 0) 72%);
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
}
.court.asking .cry-wrap { display: none; }
.cry-count {
  display: inline-block;
  margin: 18px 0 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: #f4e6c8;
  font-size: 16px;
}
.cry-count b { color: #ffd76a; }
.cry-count.bump { animation: bump 0.25s ease; }
@keyframes bump { 50% { transform: scale(1.18); } }
.cry-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: rgba(244, 230, 200, 0.7);
}
.plus {
  position: fixed;
  z-index: 7;
  font: 900 22px 'Noto Serif KR', serif;
  color: #ffd76a;
  pointer-events: none;
  animation: plus 0.8s ease-out forwards;
}
@keyframes plus {
  to { opacity: 0; transform: translateY(-60px) scale(1.3); }
}

.ask, .granted {
  position: relative;
  width: min(330px, calc(100vw - 32px));
  padding: 26px 18px 22px;
  border: 3px double var(--gold);
  border-radius: 6px;
  background: var(--paper);
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: slam 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.ask[hidden], .granted[hidden] { display: none; }
.ask-q {
  margin: 0 0 6px;
  font: 900 26px 'Noto Serif KR', serif;
  line-height: 1.35;
}

/* 윤허 버튼은 아래쪽, 도망 버튼은 위쪽 빈 곳으로만 다니게 */
/* 처음엔 양옆에 나란히. 도망이 시작되면 윤허 버튼이 가운데로 나서고, 물리거라는 그 둘레를 돈다 */
.arena {
  position: relative;
  height: 290px;
}
.yes, .no {
  position: absolute;
  cursor: pointer;
  white-space: nowrap;
}
.yes {
  left: 31%;
  top: 145px;
  z-index: 2;
  translate: -50% -50%;
  padding: 14px 18px;
  border: 0;
  border-radius: 4px;
  background: var(--red);
  color: #fbecd2;
  font: 900 20px 'Noto Serif KR', serif;
  box-shadow: 0 4px 0 #6d1510;
  transform: scale(var(--g, 1));
  transition: transform 0.25s, left 0.35s ease;
}
.arena.orbit .yes { left: 50%; }
.no {
  left: 62%;
  top: 126px;
  padding: 10px 12px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font: 700 14px 'Gowun Batang', serif;
  touch-action: none;
  transition: left 0.2s ease-out, top 0.2s ease-out;
}

/* 열 번 도망친 뒤 윤허 버튼 뒤로 숨는다 */
.no.hiding {
  z-index: 1;
  pointer-events: none;
  transform: scale(0.7) rotate(-6deg);
  opacity: 0.9;
  transition: left 0.6s cubic-bezier(0.5, 0, 0.2, 1), top 0.6s cubic-bezier(0.5, 0, 0.2, 1), transform 0.6s ease;
}
.hid-note {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  animation: fade-in 0.4s ease;
}

.granted-seal {
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  margin: 0 auto 16px;
  border: 6px double #fff2c8;
  border-radius: 10px;
  background: linear-gradient(145deg, #e9b949, #a8711c);
  color: #5c0d09;
  font: 900 86px 'Noto Serif KR', serif;
  box-shadow: 0 8px 0 #6b4510, 0 0 40px rgba(233, 185, 73, 0.6);
  animation: slam 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.granted-title {
  margin: 0 0 8px;
  font: 900 24px 'Noto Serif KR', serif;
  color: var(--red);
}
.granted-sub {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.granted-back {
  padding: 10px 16px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font: 700 14px 'Gowun Batang', serif;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .scroll, .gloss, .gloss-in, .controls { transition: none; }
  .bow, .bow::after, .spark, .bow-wrap.hey, .jokja, .hint, .army i, .cry, .rays, .herald span, .intro.rumble { animation: none; }
  .herald span { opacity: 1; }
}
