/* Holiday blocks. The night scene keeps its own colors in light and dark themes. */
.fest { position: relative; overflow: hidden; margin: 28px 0; border-radius: var(--r-panel); color: #fdf8ec; background: linear-gradient(180deg, #0b1a38 0, #13294a 380px); isolation: isolate; }
.fest-newyear { background: linear-gradient(180deg, #0a0f2a 0, #1b1648 380px); }
.fest-scene { display: block; width: 100%; max-width: 440px; margin: 0 auto; overflow: visible; }
.fest-body { position: relative; z-index: 2; padding: 4px 18px 22px; text-align: center; }
.article .fest-title { margin: 0 0 14px; color: #fff; font-size: clamp(24px, 6vw, 32px); }

.fest-snow { position: absolute; left: 0; right: 0; top: 0; height: 390px; z-index: 1; overflow: hidden; pointer-events: none; -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent); }
.fest-newyear .fest-snow { display: none; }
.fest-snow::before, .fest-snow::after { content: ""; position: absolute; left: 0; right: 0; top: -400px; height: calc(100% + 400px); background-size: 360px 400px; will-change: transform; animation: fest-fall 15s linear infinite; }
.fest-snow::before { background-image: radial-gradient(circle at 9% 12%, #fff 0 1.5px, transparent 2.2px), radial-gradient(circle at 31% 46%, #fff 0 1.8px, transparent 2.4px), radial-gradient(circle at 57% 19%, #fff 0 1.3px, transparent 2px), radial-gradient(circle at 78% 63%, #fff 0 1.7px, transparent 2.3px), radial-gradient(circle at 92% 28%, #fff 0 1.2px, transparent 1.9px), radial-gradient(circle at 18% 82%, #fff 0 1.6px, transparent 2.2px), radial-gradient(circle at 66% 90%, #fff 0 1.4px, transparent 2px), radial-gradient(circle at 44% 71%, #fff 0 1.1px, transparent 1.8px); }
.fest-snow::after { opacity: 0.8; animation-duration: 25s; background-image: radial-gradient(circle at 22% 30%, #fff 0 2.4px, transparent 3.2px), radial-gradient(circle at 71% 12%, #fff 0 2.1px, transparent 2.9px), radial-gradient(circle at 48% 58%, #fff 0 2.6px, transparent 3.4px), radial-gradient(circle at 88% 80%, #fff 0 2.2px, transparent 3px), radial-gradient(circle at 6% 66%, #fff 0 2px, transparent 2.8px); }
@keyframes fest-fall { to { transform: translateY(400px); } }

.f-light { transition: opacity 50ms linear; }
.fest .f-light { animation: fest-twinkle 2.6s ease-in-out infinite alternate; }
.fest .f-d1 { animation-delay: -0.5s; } .fest .f-d2 { animation-delay: -1s; } .fest .f-d3 { animation-delay: -1.5s; } .fest .f-d4 { animation-delay: -2s; } .fest .f-d5 { animation-delay: -2.4s; }
@keyframes fest-twinkle { from { opacity: 0.55; } to { opacity: 1; } }
.fest.is-playing .f-light { animation: none; opacity: 0.12; }
.fest.is-playing.is-on .f-light { opacity: 1; }
.fest.is-done .f-light { animation: fest-finale 0.8s ease-in-out 3 alternate; }
@keyframes fest-finale { from { opacity: 0.5; } to { opacity: 1; } }

.article .fest-letters { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin: 0 0 16px; padding: 0; list-style: none; }
.article .fest-letters li { margin: 0; color: inherit; }
.fest-static code { color: #ffe9a8; background: none; overflow-wrap: anywhere; }
.fest-letter { min-width: 30px; padding: 6px 5px 7px; border-radius: 10px; background: rgba(255, 255, 255, 0.11); transition: transform 90ms ease, background 90ms ease; }
.fest-letter b { display: block; font-size: 16px; line-height: 1.1; color: #fff; }
.fest-letter .code { --u: 3px; margin-top: 5px; color: #ffe9a8; justify-content: center; }
.fest-letter.on { background: var(--y); transform: translateY(-3px); }
.fest-letter.on b, .fest-letter.on .code { color: #1c1a17; }
.fest-word-gap { width: 12px; }

.fest-field { display: block; text-align: left; font-size: 14px; font-weight: 600; }
.fest-field span { display: block; margin-bottom: 6px; color: rgba(255, 255, 255, 0.84); }
.fest-field input { display: block; box-sizing: border-box; width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 14px; background: rgba(255, 255, 255, 0.1); color: #fff; font: inherit; font-size: 17px; font-weight: 600; letter-spacing: 0.04em; }
.fest-field input:focus { outline: 2px solid var(--y); outline-offset: 1px; }
.fest-field.dark span { color: var(--sec); }
.fest-field.dark input { border-color: var(--line); background: var(--bg); color: var(--ink); }

.fest-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.fest-btn { min-height: 48px; padding: 11px 20px; border: 1px solid rgba(255, 255, 255, 0.34); border-radius: 999px; background: transparent; color: #fff; font: inherit; font-size: 16px; font-weight: 650; cursor: pointer; }
.fest-btn:focus-visible { outline: 2px solid var(--y); outline-offset: 2px; }
.fest-btn.primary { border-color: var(--y); background: var(--y); color: #1c1a17; }
.fest-btn.soft { border-color: var(--line); background: var(--tile); color: var(--ink); }
.article .fest-status { min-height: 1.5em; margin: 12px 0 0; color: rgba(255, 255, 255, 0.86); font-size: 15px; }

.fest-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: center; margin: 28px 0; padding: 16px; border-radius: var(--r-panel); background: var(--panel); }
.fest-card canvas { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 auto; border-radius: 18px; box-shadow: 0 18px 44px rgba(12, 20, 40, 0.3); }
.article .fest-card .fest-status { color: var(--sec); text-align: center; }
@media (min-width: 640px) { .fest-card { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); } }

.fest-gifts { margin: 28px 0; }
.fest-gift-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .fest-gift-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fest-gift { display: grid; justify-items: center; gap: 10px; min-height: 176px; padding: 16px 8px 14px; border: 0; border-radius: 20px; background: var(--tile); color: var(--ink); font: inherit; cursor: pointer; }
.fest-gift:focus-visible { outline: 3px solid var(--y); outline-offset: 2px; }
.fest-box { position: relative; display: block; width: 66px; height: 52px; margin-top: 12px; border-radius: 6px; background: linear-gradient(90deg, transparent 43%, var(--y) 43% 57%, transparent 57%), #c8303f; }
.fest-gift.t1 .fest-box { background-color: #2f7f6b; }
.fest-gift.t2 .fest-box { background-color: #3b5ba5; }
.fest-lid { position: absolute; left: -5px; right: -5px; top: -11px; height: 15px; border-radius: 5px; background: linear-gradient(90deg, transparent 43%, var(--y) 43% 57%, transparent 57%), #a52532; transition: transform 320ms var(--spring); transform-origin: 12% 100%; }
.fest-gift.t1 .fest-lid { background-color: #24665a; }
.fest-gift.t2 .fest-lid { background-color: #2f4a88; }
.fest-gift[aria-pressed="true"] .fest-lid { transform: translateY(-13px) rotate(-14deg); }
.fest-tag { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px; min-height: 22px; }
.fest-tag .code { --u: 3px; }
.fest-sep { width: 7px; }
.fest-gift strong { font-size: 20px; letter-spacing: 0.06em; }
.fest-gift-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.article .fest-gift-foot p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .fest-snow::before, .fest-snow::after, .fest .f-light, .fest.is-done .f-light { animation: none; }
  .fest .f-light { opacity: 1; }
  .fest.is-playing .f-light { opacity: 0.12; }
  .fest.is-playing.is-on .f-light { opacity: 1; }
  .fest-lid, .fest-letter { transition: none; }
}

/* Letter tiles hung like baubles. */
.fest-ornaments { margin: 26px 0; }
.fest-ornaments .words { padding-top: 22px; row-gap: 26px; }
.fest-ornaments .tile { position: relative; background: #c8303f; color: #fff; }
.fest-ornaments .tile:nth-of-type(3n + 2) { background: #2f7f6b; color: #fff; }
.fest-ornaments .tile:nth-of-type(3n) { background: #e4a72f; color: #1c1a17; }
.fest-ornaments .tile::before { content: ""; position: absolute; top: -20px; left: 50%; width: 2px; height: 20px; background: var(--line); }
.fest-ornaments .tile::after { content: ""; position: absolute; top: -6px; left: 50%; width: 16px; height: 7px; margin-left: -7px; border-radius: 3px 3px 0 0; background: var(--ter); }
.fest-ornaments .tile .code, .fest-ornaments .tile .ch { color: inherit; }
.fest-ornaments .tile.on { background: var(--y); color: var(--on-y); }
.article .fest-title { padding-top: 0; border: 0; }
