.chuseok {
  --ch-sky-top: #04070F;
  --ch-sky-mid: #0A1330;
  --ch-sky-low: #182450;
  --ch-moon: #FFF6D9;
  --ch-moon-edge: #F0DCA4;
  --ch-moon-shadow: #C2A469;
  --ch-hill-far: #0A1026;
  --ch-hill-near: #05080F;
  --ch-ink: #FFFFFF;
  --ch-ink-2: #C6CDE4;
  --ch-ink-3: #8C96B8;

  background: var(--ch-sky-top);
  color: var(--ch-ink);
}

.ch-sky {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% 6%, rgba(255, 246, 217, .10) 0%, transparent 58%),
    linear-gradient(180deg, var(--ch-sky-top) 0%, var(--ch-sky-mid) 52%, var(--ch-sky-low) 100%);
  pointer-events: none;
}

.ch-stars {
  position: absolute;
  inset: -10% 0 30%;
  background-repeat: repeat;
}
.ch-stars.s1 {
  background-image:
    radial-gradient(1.4px 1.4px at 24px 32px, rgba(255,255,255,.95), transparent),
    radial-gradient(1.1px 1.1px at 96px 12px, rgba(255,255,255,.75), transparent),
    radial-gradient(1.6px 1.6px at 148px 88px, rgba(255,255,255,.9), transparent),
    radial-gradient(1px 1px at 60px 124px, rgba(255,255,255,.65), transparent);
  background-size: 190px 170px;
  animation: ch-twinkle 4.2s ease-in-out infinite;
}
.ch-stars.s2 {
  background-image:
    radial-gradient(1.2px 1.2px at 40px 70px, rgba(214,228,255,.8), transparent),
    radial-gradient(1.8px 1.8px at 130px 30px, rgba(255,255,255,.85), transparent),
    radial-gradient(1px 1px at 200px 110px, rgba(255,236,196,.7), transparent);
  background-size: 260px 230px;
  animation: ch-twinkle 6.4s ease-in-out infinite reverse;
  animation-delay: -1.7s;
}
.ch-stars.s3 {
  background-image:
    radial-gradient(2.2px 2.2px at 78px 46px, rgba(255,255,255,.7), transparent),
    radial-gradient(1.3px 1.3px at 240px 150px, rgba(255,246,217,.6), transparent);
  background-size: 340px 300px;
  opacity: .8;
  animation: ch-drift 90s linear infinite;
}
@keyframes ch-twinkle {
  0%, 100% { opacity: .55; }
  50%      { opacity: 1; }
}
@keyframes ch-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-340px, 0, 0); }
}

.ch-veil {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 62%;
  background: linear-gradient(180deg, transparent 0%, rgba(4, 7, 15, .72) 46%, rgba(4, 7, 15, .92) 100%);
}

.ch-moon {
  position: absolute;
  top: calc(var(--safe-top) + 50px);
  left: 50%;
  width: min(226px, 58vw);
  transform: translateX(-50%);
}
.ch-moon::before {
  content: '';
  position: absolute;
  inset: -42%;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 246, 217, .28) 0%,
    rgba(255, 246, 217, .12) 42%,
    transparent 68%);
  animation: ch-halo 6s ease-in-out infinite;
}
@keyframes ch-halo {
  0%, 100% { opacity: .8; transform: scale(1); }
  50%      { opacity: 1;  transform: scale(1.05); }
}

.ch-moon-svg { width: 100%; height: auto; display: block; }

.ch-crater { fill: var(--ch-moon-edge); opacity: .5; }

.ch-rabbit { color: var(--ch-moon-shadow); opacity: .72; }

.ch-rabbit-body {
  transform-box: view-box;
  transform-origin: 132px 148px;
  animation: ch-bob 1.6s var(--spring-soft) infinite;
}
@keyframes ch-bob {
  0%, 36%  { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(2.5px) rotate(-2deg); }
  62%      { transform: translateY(0) rotate(0deg); }
  100%     { transform: translateY(0) rotate(0deg); }
}

.ch-pestle {
  transform-box: view-box;
  transform-origin: 112px 96px;
  animation: ch-pound 1.6s cubic-bezier(.4, 0, .25, 1) infinite;
}
@keyframes ch-pound {
  0% { transform: rotate(32deg); }
  36%  { transform: rotate(32deg); }
  50% { transform: rotate(0deg); }
  56% { transform: rotate(6deg); }
  64%  { transform: rotate(0deg); }
  100% { transform: rotate(32deg); }
}

.ch-dough {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: ch-squash 1.6s cubic-bezier(.4, 0, .25, 1) infinite;
}
@keyframes ch-squash {
  0%, 46%  { transform: scale(1, 1); }
  52%      { transform: scale(1.18, .68); }
  64%      { transform: scale(.96, 1.06); }
  76%, 100% { transform: scale(1, 1); }
}

.ch-puff {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: ch-puff 1.6s ease-out infinite;
}
.ch-puff.p2 { animation-delay: 40ms; }
@keyframes ch-puff {
  0%, 48%  { opacity: 0; transform: translate(0, 0) scale(.4); }
  56%      { opacity: .75; }
  78%, 100% { opacity: 0; transform: translate(var(--px, -10px), -14px) scale(1.3); }
}

.ch-hills {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 34%;
  min-height: 160px;
}
.ch-hills svg { width: 100%; height: 100%; display: block; }
.ch-hill-far { fill: var(--ch-hill-far); }
.ch-hill-near { fill: var(--ch-hill-near); }

.ch-reed {
  fill: none;
  stroke: var(--ch-hill-far);
  stroke-width: 1.6;
  stroke-linecap: round;
  transform-box: fill-box;
  transform-origin: bottom center;
  animation: ch-sway 7s ease-in-out infinite;
}
.ch-reed.r2 { animation-delay: -2.4s; animation-duration: 8.4s; }
.ch-reed.r3 { animation-delay: -4.8s; animation-duration: 6.2s; }
@keyframes ch-sway {
  0%, 100% { transform: rotate(-3deg); }
  50%      { transform: rotate(3.5deg); }
}

.chuseok .topbar { position: relative; z-index: 2; }
.chuseok .topbar .icon-btn { color: var(--ch-ink); }
.chuseok .topbar .title { color: var(--ch-ink); }

.ch-scroll { position: relative; z-index: 2; }

.ch-corner {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
}
.chuseok .topbar.has-corner .title { padding-right: 92px; }
.ch-corner-btn {
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  color: var(--ch-ink);
  font-size: var(--t-label-md-size);
  font-weight: 700;
  white-space: nowrap;
  transition: transform var(--dur-press) var(--spring-soft), opacity 120ms linear;
}
.ch-corner-btn:active:not(:disabled) { transform: scale(.94); }
.ch-corner-btn:disabled { opacity: .55; }
.ch-corner-btn.on {
  background: transparent;
  border-color: rgba(255, 255, 255, .28);
  color: var(--ch-ink-2);
}

.ch-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 24px calc(24px + var(--safe-bottom));
  padding-top: min(300px, calc(58vw + 92px));
}

.ch-eyebrow {
  color: var(--ch-moon);
  letter-spacing: .14em;
  opacity: .85;
}
.ch-title {
  margin-top: 8px;
  font-size: 26px;
  line-height: 34px;
  font-weight: 700;
  color: var(--ch-ink);
  white-space: pre-line;
  text-shadow: 0 2px 18px rgba(4, 7, 15, .8);
}
.ch-lead {
  margin-top: 12px;
  max-width: 30ch;
  color: var(--ch-ink-2);
  white-space: pre-line;
}

.ch-target {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 12px 20px 12px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
}
.ch-target .col { align-items: flex-start; text-align: left; }
.ch-target-name { color: var(--ch-ink); }
.ch-target-handle { color: var(--ch-ink-3); }

.ch-plate {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.ch-plate-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 260px;
}
.ch-plate-row svg { width: 34px; height: auto; }
.ch-plate-count { color: var(--ch-moon); }
.ch-plate-empty { color: var(--ch-ink-3); white-space: pre-line; }
.ch-plate-hint { color: var(--ch-ink-3); }

.ch-piece {
  display: block;
  padding: 0;
  background: none;
  border-radius: calc(10px * var(--r-k));
  transition: transform var(--dur-press) var(--spring-soft);
  corner-shape: superellipse(1.5);
}
.ch-piece:active { transform: scale(.88); }
.ch-piece:focus-visible { outline: 2px solid var(--ch-moon); outline-offset: 2px; }

.ch-plate-more {
  margin-top: 2px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .06);
  color: var(--ch-ink-2);
  font-size: var(--t-label-md-size);
  font-weight: 700;
}

.ch-cta {
  position: relative;
  z-index: 2;
  flex: none;
  padding: 12px 20px calc(16px + var(--safe-bottom));
  background: linear-gradient(180deg, transparent, rgba(4, 7, 15, .9) 42%);
}
.ch-gift-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 56px;
  border-radius: calc(16px * var(--r-k));
  background: linear-gradient(135deg, var(--accent-bright), var(--accent-dark));
  color: #04150E;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(4, 226, 144, .22);
  transition: transform var(--dur-press) var(--spring-soft), opacity 120ms linear;
  corner-shape: superellipse(1.5);
}
.ch-gift-btn:active:not(:disabled) { transform: scale(.985); }
.ch-gift-btn svg { width: 26px; height: auto; }

.ch-gift-btn:disabled {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  color: var(--ch-ink-2);
  box-shadow: none;
  cursor: default;
}
.ch-gift-btn:disabled svg { opacity: .8; }

.ch-cta-note {
  margin-top: 10px;
  text-align: center;
  color: var(--ch-ink-3);
  white-space: pre-line;
}
.ch-cta-note a { color: var(--ch-ink-2); text-decoration: underline; }

.ch-share-btn {
  width: 100%;
  height: 52px;
  margin-top: 10px;
  border-radius: calc(16px * var(--r-k));
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  color: var(--ch-ink);
  font-weight: 700;
  corner-shape: superellipse(1.5);
}

.ch-flavors {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.ch-flavor {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  border-radius: calc(14px * var(--r-k));
  background: var(--card);
  border: 1.5px solid transparent;
  transition: border-color 120ms linear, transform var(--dur-press) var(--spring-soft);
  corner-shape: superellipse(1.5);
}
.ch-flavor svg { width: 40px; height: auto; }
.ch-flavor span { font-size: var(--t-label-md-size); color: var(--text-3); }
.ch-flavor.selected { border-color: var(--accent); }
.ch-flavor.selected span { color: var(--text-1); font-weight: 700; }
.ch-flavor:active { transform: scale(.96); }

.ch-sheet-counter { display: flex; justify-content: flex-end; margin-top: 6px; }

.ch-letter-seal {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}
.ch-letter-seal svg { width: 64px; height: auto; }
.ch-letter-seal.sealed svg { filter: grayscale(.85); opacity: .5; }

.ch-letter-head { text-align: center; overflow-wrap: anywhere; }
.ch-letter-note {
  margin-top: 6px;
  text-align: center;
  white-space: pre-line;
}
.ch-letter-body {
  margin-top: 14px;
  padding: 16px;
  border-radius: calc(14px * var(--r-k));
  background: var(--card);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 44vh;
  overflow-y: auto;
  corner-shape: superellipse(1.5);
}

.ch-letter-list {
  margin-top: 14px;
  max-height: 52vh;
  overflow-y: auto;
}
.ch-letter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 6px;
  text-align: left;
  border-radius: calc(12px * var(--r-k));
  transition: background-color 120ms linear;
  corner-shape: superellipse(1.5);
}
.ch-letter-row + .ch-letter-row { border-top: 1px solid var(--divider); }
.ch-letter-row:active { background: var(--card); }
.ch-letter-row > svg { width: 34px; height: auto; flex: none; }
.ch-letter-row .col { align-items: flex-start; min-width: 0; }

.ch-cast {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background: radial-gradient(120% 80% at 50% 30%, #0B1533 0%, #04070F 100%);
  animation: ch-cast-in 260ms ease-out both;
}
@keyframes ch-cast-in { from { opacity: 0; } to { opacity: 1; } }
.ch-cast.leaving { animation: fade-out 240ms linear both; }

.ch-cast-stage {
  position: relative;
  width: 200px;
  height: 200px;
  display: grid;
  place-items: center;
}

.ch-note, .ch-cast-cake { grid-area: 1 / 1; place-self: center; }

.ch-note {
  width: 168px;
  max-height: 168px;
  overflow: hidden;
  padding: 16px 16px 18px;
  border-radius: 6px;
  background: linear-gradient(160deg, #FFFDF4, #F3EBD6);
  color: #2A2418;
  text-align: left;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
  transform-origin: center 62%;
  backface-visibility: hidden;
}
.ch-note-title { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.ch-note-body {
  font-size: 11.5px;
  line-height: 17px;
  color: #5A5140;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  overflow: hidden;
}

.ch-cast-cake {
  width: 96px;
  opacity: 0;
  transform: scale(.2);
}
.ch-cast-cake svg { width: 100%; height: auto; }

.ch-cast-caption {
  color: var(--ch-ink, #fff);
  text-align: center;
  min-height: 22px;
  white-space: pre-line;
}
.ch-cast-sub {
  margin-top: -18px;
  max-width: 30ch;
  color: #C6CDE4;
  text-align: center;
  white-space: pre-line;
}
.ch-cast-wait {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -14px;
  color: #8C96B8;
}
.ch-cast-wait .spinner { border-color: rgba(255, 255, 255, .22); border-top-color: #C6CDE4; }

.ch-cast.phase-fold .ch-note { animation: ch-fold 900ms cubic-bezier(.5, 0, .3, 1) both; }
@keyframes ch-fold {
  0%   { transform: perspective(600px) rotateX(0deg) scale(1); opacity: 1; }
  46%  { transform: perspective(600px) rotateX(-14deg) scale(1.04); opacity: 1; }
  100% { transform: perspective(600px) rotateX(78deg) scaleY(.24) scale(.6); opacity: 0; }
}

.ch-cast.phase-shape .ch-note,
.ch-cast.phase-fly .ch-note,
.ch-cast.phase-done .ch-note,
.ch-cast.phase-already .ch-note,
.ch-cast.phase-invite .ch-note,
.ch-cast.phase-fail .ch-note { opacity: 0; }

.ch-cast.phase-shape .ch-cast-cake { animation: ch-knead 700ms var(--spring) both; }
@keyframes ch-knead {
  0%   { opacity: 0; transform: scale(.24) rotate(-12deg); }
  40%  { opacity: 1; transform: scale(1.16, .82) rotate(2deg); }
  64%  { transform: scale(.93, 1.08) rotate(-1deg); }
  82%  { transform: scale(1.04, .97); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.ch-cast.phase-fly .ch-cast-cake { animation: ch-fly 900ms cubic-bezier(.4, 0, .2, 1) both; }
@keyframes ch-fly {
  0%   { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
  30% { transform: translateY(14px) scale(.94) rotate(-3deg); }
  100% { opacity: 0; transform: translateY(-260px) scale(.34) rotate(8deg); }
}

.ch-sparks { position: absolute; inset: 0; pointer-events: none; }
.ch-spark {
  position: absolute;
  left: 50%; top: 50%;
  width: 5px; height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: var(--ch-moon, #FFF6D9);
  opacity: 0;
}
.ch-cast.phase-fly .ch-spark { animation: ch-spark 820ms ease-out both; }
@keyframes ch-spark {
  0%   { opacity: 0; transform: rotate(var(--a)) translateX(0) scale(.6); }
  22%  { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateX(96px) scale(.2); }
}

.ch-cast.phase-done .ch-cast-stage::after,
.ch-cast.phase-already .ch-cast-stage::after,
.ch-cast.phase-fail .ch-cast-stage::after {
  content: '';
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  animation: ch-landed 620ms var(--spring) both;
}
.ch-cast.phase-done .ch-cast-stage::after {
  background: radial-gradient(circle, rgba(255, 246, 217, .5), transparent 66%);
}
.ch-cast.phase-already .ch-cast-stage::after {
  background: radial-gradient(circle, rgba(255, 246, 217, .26), transparent 66%);
}
.ch-cast.phase-fail .ch-cast-stage::after {
  background: radial-gradient(circle, rgba(255, 77, 79, .3), transparent 66%);
}

.ch-cast.phase-already .ch-cast-cake { animation: ch-settle 520ms var(--spring) both; }
@keyframes ch-settle {
  from { opacity: 0; transform: scale(.7); }
  to   { opacity: .85; transform: scale(.9); }
}

.ch-cast.phase-invite .ch-cast-cake { animation: ch-invite-drop 620ms var(--spring) both; }
@keyframes ch-invite-drop {
  0%   { opacity: 0; transform: translateY(-40px) scale(.5); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.ch-cast.phase-invite .ch-cast-stage::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 26%;
  width: 116px;
  height: 18px;
  margin-left: -58px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 246, 217, .22), transparent 70%);
  animation: ch-landed 620ms var(--spring) both;
}
@keyframes ch-landed {
  from { opacity: 0; transform: scale(.5); }
  to   { opacity: 1; transform: scale(1); }
}

.ch-cast-actions { display: flex; gap: 10px; }

@media (prefers-reduced-motion: reduce) {
  .ch-stars, .ch-moon::before, .ch-rabbit-body, .ch-pestle,
  .ch-dough, .ch-puff, .ch-reed { animation: none !important; }
  .ch-cast, .ch-cast * { animation-duration: 1ms !important; }
}

:root.no-effects .ch-stars,
:root.no-effects .ch-moon::before,
:root.no-effects .ch-rabbit-body,
:root.no-effects .ch-pestle,
:root.no-effects .ch-dough,
:root.no-effects .ch-puff,
:root.no-effects .ch-reed { animation: none; }

@media (min-width: 601px) {
  .ch-moon { width: 250px; }
  .ch-inner { padding-top: 350px; }
  .ch-title { font-size: 30px; line-height: 38px; }
  .ch-cta { max-width: var(--read-max-width); margin: 0 auto; width: 100%; }
}
