/* Thiệp cuối năm & Tết (play-tet.js): xin xăm, bốc lì xì, ông đồ cho chữ, bầu cua, hái lộc, sớ Táo quân, hũ điều ước.
   Kích thước theo em của .pl (1em ≈ 1/21 cạnh khung) như fun.css / viral.css. */
.pl-xinxam, .pl-boclixi, .pl-ongdo, .pl-baucua, .pl-haloc, .pl-taoquan, .pl-wishjar { gap: max(2cqmin, .7em); }
.pl-xinxam button, .pl-boclixi button, .pl-ongdo button, .pl-baucua button, .pl-haloc button, .pl-taoquan button, .pl-wishjar button { -webkit-user-select: none; user-select: none; touch-action: manipulation; }
@keyframes tt-pulse { 0%, 100% { filter: drop-shadow(0 0 0 transparent); } 50% { filter: drop-shadow(0 0 .7em color-mix(in srgb, var(--accent2) 90%, transparent)); } }
@keyframes tt-unroll { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }

/* ---------- 1. xin xăm ---------- */
.xx-stage { position: relative; width: 15em; height: 15.5em; }
.xx-tube { position: absolute; left: 50%; bottom: 0; width: 7.2em; height: 14em; margin-left: -3.6em; padding: 0; border: 0; background: none; cursor: pointer; transform-origin: 50% 92%; }
.xx-stage:not(.drawn) .xx-tube:not(.shaking) { animation: tt-pulse 2s ease-in-out infinite; }
.xx-sticks { position: absolute; left: 50%; bottom: 7.4em; width: 0; height: 0; }
.xx-sticks i { position: absolute; bottom: -1.6em; left: var(--x); width: .4em; height: var(--h); margin-left: -.2em; border-radius: .2em .2em .05em .05em; transform: rotate(var(--r)); transform-origin: 50% 100%;
  background: linear-gradient(#c92a2a 0 1em, transparent 1em), linear-gradient(90deg, #c8914c, #f1d39c 50%, #b97f3a); box-shadow: 0 0 .1em rgba(0, 0, 0, .3); }
.xx-tube.shaking .xx-sticks i { animation: xx-jig .11s ease-in-out infinite alternate; }
.xx-tube.shaking .xx-sticks i:nth-child(odd) { animation-delay: .05s; }
@keyframes xx-jig { to { translate: 0 -.5em; } }
.xx-body { position: absolute; left: 0; right: 0; bottom: 0; height: 8.6em; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1em; border-radius: .5em .5em 1.3em 1.3em;
  background: linear-gradient(transparent 12%, rgba(60, 25, 5, .35) 12% 14%, transparent 14% 86%, rgba(60, 25, 5, .35) 86% 88%, transparent 88%), linear-gradient(90deg, #6b3410, #b3662a 16%, #e2a55c 42%, #c27b36 70%, #5e2d0d);
  box-shadow: 0 1em 1.6em -.8em rgba(0, 0, 0, .6); }
.xx-body::before { content: ''; position: absolute; left: 0; right: 0; top: -.6em; height: 1.3em; border-radius: 50%; background: radial-gradient(ellipse at 50% 55%, #2b1305 0 52%, #a45c22 56%, #d79a52 70%, #7a3e12); }
.xx-body b, .xx-body small { position: relative; padding: 0 .55em; color: #ffe8a3; text-shadow: 0 .05em .1em rgba(0, 0, 0, .5); }
.xx-body b { font-family: var(--tf); font-weight: 400; font-size: 1.45em; line-height: 1.1; padding: .15em .45em; border-radius: .2em; background: color-mix(in srgb, var(--accent) 85%, #000); box-shadow: inset 0 0 0 .07em #ffd96a; }
.xx-body small { font-size: .62em; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.xx-tube.shaking { animation: xx-shake .17s ease-in-out infinite alternate; }
@keyframes xx-shake { from { transform: rotate(-13deg) translateY(-.25em); } to { transform: rotate(11deg) translateY(.1em); } }
.xx-stick { position: absolute; left: calc(50% + 4.2em); bottom: .4em; width: 1.05em; height: 8.6em; padding: 0; border: 0; border-radius: .3em .3em .1em .1em; cursor: pointer; opacity: 0; pointer-events: none; rotate: 16deg; transform-origin: 50% 100%;
  display: grid; place-items: center; background: linear-gradient(#c92a2a 0 1.7em, transparent 1.7em), linear-gradient(90deg, #c8914c, #f6dca8 50%, #b97f3a); box-shadow: 0 .3em .6em rgba(0, 0, 0, .4); }
.xx-stick span { writing-mode: vertical-rl; text-orientation: upright; margin-top: 1.4em; font-weight: 900; font-size: .78em; letter-spacing: -.08em; color: #8b1a1a; }
.xx-stage.drawn .xx-stick { opacity: 1; pointer-events: auto; animation: xx-fly .9s cubic-bezier(.3, .7, .4, 1) both, tt-pulse 1.6s .9s ease-in-out infinite; }
.static .xx-stage.drawn .xx-stick, .xx-stage.read .xx-stick { animation: none; }
@keyframes xx-fly { 0% { transform: translate(-4.2em, -6em) rotate(-16deg); opacity: 0; } 15% { opacity: 1; } 55% { transform: translate(-2em, -11em) rotate(160deg); } 100% { transform: none; } }
.xx-ov { position: absolute; inset: 0; z-index: 6; display: none; place-items: center; padding: 4cqmin; background: color-mix(in srgb, var(--ink) 30%, transparent); backdrop-filter: blur(2px); }
.xx-ov.open { display: grid; animation: fn-fade .3s ease both; }
.xx-slip { position: relative; width: min(19.5em, 100%); max-height: 100%; overflow: auto; padding: 1em 1.2em .9em; color: #3b1d10; text-align: center; scrollbar-width: none;
  background: radial-gradient(circle at 20% 15%, rgba(255, 255, 255, .5), transparent 40%), linear-gradient(#fff6dc, #fbe7b4); box-shadow: inset 0 0 0 .3em #fff6dc, inset 0 0 0 .4em #c92a2a, 0 1em 2.6em -.6em rgba(0, 0, 0, .55);
  animation: tt-unroll .8s cubic-bezier(.2, .8, .3, 1) both; }
.xx-rod { display: block; height: .5em; margin: -.55em -.7em .6em; border-radius: .3em; background: linear-gradient(#b5652e, #5c2a0e); }
.xx-rod:last-child { margin: .6em -.7em -.45em; }
.xx-head small { display: block; font-size: .66em; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #a61e1e; }
.xx-head b { display: block; margin: .05em 0 .25em; font-family: var(--tf); font-weight: 400; font-size: 2em; line-height: 1.1; color: #c92a2a; text-shadow: 0 .04em 0 #ffd96a; }
.xx-rows { margin: 0; text-align: left; }
.xx-row { display: grid; grid-template-columns: 5.2em 1fr; gap: .5em; align-items: baseline; padding: .42em 0; border-top: 1px dashed rgba(166, 30, 30, .35); animation: pl-up .5s ease both; }
.xx-row dt { font-size: .7em; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: #a61e1e; }
.xx-row dd { margin: 0; font-size: .86em; line-height: 1.38; }
.xx-luck { margin: .5em 0 0; padding: .4em .6em; border-radius: .6em; font-size: .7em; font-weight: 700; line-height: 1.45; background: rgba(201, 42, 42, .1); color: #8b1a1a; }
.xx-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: .5em; margin-top: .7em; }
.xx-foot:empty { display: none; }

/* ---------- 2. bốc lì xì ---------- */
.lx-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 1em .9em; width: 19.2em; }
.lx-env { --red: color-mix(in srgb, var(--accent) 70%, #c1121f); position: relative; width: 5.5em; height: 7.6em; padding: 0; border: 0; border-radius: .45em; overflow: hidden; cursor: pointer; rotate: var(--r);
  background: radial-gradient(circle, rgba(255, 215, 110, .22) .1em, transparent .12em) 0 0 / .85em .85em, linear-gradient(160deg, color-mix(in srgb, var(--red) 80%, #fff), var(--red) 40%, color-mix(in srgb, var(--red) 70%, #000));
  box-shadow: inset 0 0 0 .13em color-mix(in srgb, var(--accent2) 80%, transparent), 0 .5em 1em -.4em rgba(0, 0, 0, .55); transition: transform .25s, filter .3s; }
.lx-env:hover { transform: translateY(-.3em) scale(1.04); }
.lx-flap { position: absolute; left: 0; right: 0; top: 0; height: 3.3em; clip-path: polygon(0 0, 100% 0, 100% 42%, 50% 100%, 0 42%);
  background: linear-gradient(color-mix(in srgb, var(--red) 75%, #000), color-mix(in srgb, var(--red) 88%, #000)); }
.lx-seal { position: absolute; left: 50%; top: 2.15em; width: 2.5em; height: 2.5em; margin-left: -1.25em; display: grid; place-items: center; border-radius: 50%; z-index: 1;
  background: radial-gradient(circle at 35% 30%, #fff6cc, var(--accent2) 58%, color-mix(in srgb, var(--accent2) 65%, #000)); color: color-mix(in srgb, var(--accent) 70%, #7a0b0b);
  font-family: var(--tf); font-size: 1.05em; font-weight: 700; box-shadow: 0 .15em .3em rgba(0, 0, 0, .35); }
.lx-done { position: absolute; left: .2em; right: .2em; bottom: .6em; font-size: .66em; font-weight: 800; line-height: 1.2; color: #ffe8a3; opacity: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx-env.opened { filter: saturate(.5) brightness(.88); }
.lx-env.opened .lx-done { opacity: 1; }
.lx-env.opened .lx-flap { clip-path: polygon(0 0, 100% 0, 100% 0, 50% 0, 0 0); }
.lx-grid.shuffle .lx-env { animation: lx-shuf .8s ease-in-out 2 alternate; pointer-events: none; }
.lx-grid.shuffle .lx-env:nth-child(3n+1) { --sx: 6.4em; }
.lx-grid.shuffle .lx-env:nth-child(3n+2) { --sx: 0em; }
.lx-grid.shuffle .lx-env:nth-child(3n) { --sx: -6.4em; }
.lx-grid.shuffle .lx-env:nth-child(-n+3) { --sy: 4.3em; }
.lx-grid.shuffle .lx-env:nth-child(n+4) { --sy: -4.3em; }
@keyframes lx-shuf { 50% { transform: translate(calc(var(--sx) * .5), calc(var(--sy) * .5)) rotate(12deg) scale(.92); } 100% { transform: translate(var(--sx), var(--sy)) rotate(-6deg); } }
.lx-foot { display: flex; flex-direction: column; align-items: center; gap: .6em; }
.lx-count { margin: 0; min-height: 1.2em; font-size: .78em; font-weight: 700; opacity: .8; }
.lx-ov { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.4em; padding: 4cqmin;
  background: color-mix(in srgb, var(--ink) 40%, transparent); backdrop-filter: blur(3px); animation: fn-fade .3s ease both; }
.lx-ov.out { animation: fn-fade .3s ease reverse forwards; }
.lx-big { --red: color-mix(in srgb, var(--accent) 70%, #c1121f); position: relative; width: 14em; display: flex; justify-content: center; padding-bottom: 1em; }
.lx-note { position: relative; z-index: 1; width: 13.6em; padding: .7em 1em .8em; border-radius: .5em; text-align: center; color: #3b2a10;
  background: repeating-radial-gradient(circle at 85% 50%, transparent 0 .35em, rgba(160, 110, 20, .1) .35em .42em), linear-gradient(120deg, #fff7d6, #ffe38f 55%, #f6c453);
  box-shadow: inset 0 0 0 .22em #fff7d6, inset 0 0 0 .32em color-mix(in srgb, var(--accent2) 60%, #8a5a12), 0 1em 2em -.6em rgba(0, 0, 0, .5);
  animation: lx-rise 1s .15s cubic-bezier(.25, 1.3, .5, 1) both; }
.lx-note small { display: block; font-size: .6em; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #8a5a12; }
.lx-note b { display: block; margin: .05em 0; font-family: var(--tf); font-weight: 400; font-size: 2.3em; line-height: 1.1; color: color-mix(in srgb, var(--accent) 75%, #6b0f0f); overflow-wrap: anywhere; }
.lx-note p { margin: 0; font-size: .9em; font-weight: 600; line-height: 1.4; text-wrap: balance; }
.lx-serial { display: block; margin-top: .45em; font-style: normal; font-size: .58em; letter-spacing: .2em; color: #b0471b; opacity: .75; }
@keyframes lx-rise { from { transform: translateY(5em) scale(.7); opacity: 0; } 30% { opacity: 1; } }
.lx-pocket { position: absolute; z-index: 2; left: .2em; right: .2em; bottom: -1.2em; height: 7em; border-radius: .3em .3em .7em .7em; clip-path: polygon(0 0, 50% 26%, 100% 0, 100% 100%, 0 100%);
  background: radial-gradient(circle, rgba(255, 215, 110, .22) .1em, transparent .12em) 0 0 / .85em .85em, linear-gradient(170deg, color-mix(in srgb, var(--red) 85%, #fff), var(--red) 50%, color-mix(in srgb, var(--red) 70%, #000));
  animation: lx-drop .7s 1.05s ease-in forwards; }
.lx-big > .lx-seal { top: auto; bottom: 1.1em; z-index: 3; animation: lx-drop .7s 1.05s ease-in forwards; }
@keyframes lx-drop { to { transform: translateY(5em); opacity: 0; } }

/* ---------- 3. ông đồ cho chữ ---------- */
.od-desk { --giay: color-mix(in srgb, var(--accent) 55%, #b3121b); position: relative; display: flex; align-items: flex-start; justify-content: center; gap: .55em; }
.od-desk .od-paper, .od-scroll { background: radial-gradient(circle, rgba(255, 210, 80, .55) .05em, transparent .08em) 0 0 / 1.3em 1.1em, radial-gradient(circle, rgba(255, 210, 80, .35) .04em, transparent .07em) .55em .6em / 1.7em 1.5em, linear-gradient(160deg, color-mix(in srgb, var(--giay) 88%, #fff), var(--giay) 45%, color-mix(in srgb, var(--giay) 78%, #000));
  box-shadow: 0 .8em 1.6em -.7em rgba(0, 0, 0, .6); }
.od-paper { position: relative; width: 11.6em; height: 16em; padding: 0; border: 0; border-radius: .2em; cursor: pointer; display: flex; flex-direction: column; align-items: center; color: inherit; }
.od-paper::before { content: ''; position: absolute; inset: .45em; border: .07em solid rgba(255, 214, 102, .7); border-radius: .1em; pointer-events: none; }
.od-desk:not(.writing):not(.done) .od-paper { animation: tt-pulse 1.8s ease-in-out infinite; }
.od-paper svg { flex: none; width: 10.6em; height: 10.6em; margin-top: 1em; overflow: visible; }
.od-paper text { font-family: 'Comforter Brush', cursive; fill: #141010; fill-opacity: 0; stroke: #141010; stroke-width: 1.1; stroke-dasharray: 1400; stroke-dashoffset: 1400; paint-order: stroke; }
.od-desk.writing text { animation: od-ink 3s cubic-bezier(.4, .1, .4, 1) forwards; }
.od-desk.done text { stroke-dashoffset: 0; fill-opacity: 1; }
@keyframes od-ink { 75% { stroke-dashoffset: 0; fill-opacity: .15; } 100% { stroke-dashoffset: 0; fill-opacity: 1; } }
.od-mean { position: relative; margin: 0 1em; font-family: var(--tf); font-size: .92em; line-height: 1.25; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; color: #ffe39a; text-align: center; text-wrap: balance; text-shadow: 0 .05em .15em rgba(0, 0, 0, .4); opacity: 0; transition: opacity .8s .2s; }
.od-desk.done .od-mean { opacity: 1; }
.od-seal { position: absolute; top: 1em; right: .95em; width: 2.4em; height: 2.4em; display: grid; place-items: center; border-radius: .25em; overflow: hidden;
  background: #f4ead2; color: #b3121b; box-shadow: inset 0 0 0 .12em #b3121b, inset 0 0 0 .2em #f4ead2, inset 0 0 0 .26em #b3121b; opacity: 0; rotate: -8deg; }
.od-seal span { max-width: 4.2em; font-size: .5em; font-weight: 900; line-height: 1; text-transform: uppercase; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.od-desk.sealed .od-seal { opacity: 1; animation: od-stamp .45s cubic-bezier(.3, 1.6, .5, 1) both; }
.static .od-desk .od-seal { opacity: 1; }
@keyframes od-stamp { from { transform: scale(2.4); opacity: 0; } }
.od-brush { position: absolute; left: 50%; top: 22%; z-index: 2; font-size: 2.4em; font-style: normal; opacity: 0; pointer-events: none; }
.od-desk.writing:not(.done) .od-brush { animation: od-brush 3s ease-in-out both; }
@keyframes od-brush { 0% { opacity: 0; transform: translate(-2em, 1em); } 10% { opacity: 1; } 25% { transform: translate(-1em, -.5em); } 45% { transform: translate(.2em, 1.6em); } 65% { transform: translate(1em, -.2em); } 85% { opacity: 1; transform: translate(1.6em, 1.4em); } 100% { opacity: 0; transform: translate(2.4em, .4em); } }
.od-scroll { width: 3.2em; min-height: 16em; padding: .9em .1em; display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; gap: .2em; border-radius: .15em .15em .5em .5em; clip-path: inset(0 0 100% 0); transition: clip-path 1.3s ease; }
.od-scroll.right { transition-delay: .45s; }
.od-desk.pairs .od-scroll { clip-path: inset(0 0 0 0); }
.od-scroll span { max-width: 100%; font-family: var(--tf); font-size: .86em; font-weight: 700; line-height: 1.05; color: #ffe39a; text-align: center; white-space: nowrap; text-shadow: 0 .06em .12em rgba(0, 0, 0, .45); }
.od-scroll::before { content: ''; position: absolute; inset: .3em; border: .06em solid rgba(255, 214, 102, .55); pointer-events: none; }
.od-scroll { position: relative; }
.od-foot { display: flex; justify-content: center; min-height: 2.6em; }

/* ---------- 4. bầu cua ---------- */
.bc-face { display: inline-grid; place-items: center; width: 1.2em; height: 1.2em; line-height: 1; }
.bc-face svg { width: 100%; height: 100%; }
.bc-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35em; width: 17em; padding: .45em; border-radius: .7em; background: #fff6e2; box-shadow: inset 0 0 0 .14em var(--accent), 0 .5em 1em -.5em rgba(0, 0, 0, .4); }
.bc-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: .05em; padding: .3em 0 .25em; border-radius: .45em; background: color-mix(in srgb, var(--accent) 9%, #fff); transition: transform .3s, background .3s; }
.bc-tile .bc-face { font-size: 1.65em; }
.bc-tile small { font-size: .66em; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-deep, var(--accent)); }
.bc-tile.hit { background: var(--accent2); transform: scale(1.07); box-shadow: 0 .3em .7em -.2em rgba(0, 0, 0, .35); }
.bc-tile[data-n]:not([data-n=""])::after { content: attr(data-n); position: absolute; top: -.35em; right: -.25em; padding: .1em .4em; border-radius: 1em; font-size: .62em; font-weight: 900; color: #fff; background: var(--accent); }
.bc-plate { position: relative; width: 13em; height: 8em; padding: 0; border: 0; background: none; cursor: pointer; }
.bc-plate:not(.open):not(.shaking) { animation: tt-pulse 1.8s ease-in-out infinite; }
.bc-dish { position: absolute; left: 0; right: 0; bottom: 0; height: 4.8em; border-radius: 50%; background: radial-gradient(ellipse at 50% 42%, #fff 0 48%, #eef1f4 58%, #c9d0d8 72%, #9aa4ae); box-shadow: 0 .6em 1em -.4em rgba(0, 0, 0, .5); }
.bc-dice { position: absolute; left: 50%; bottom: 1.3em; display: flex; gap: .35em; translate: -50% 0; }
.bc-die { width: 2.4em; height: 2.4em; display: grid; place-items: center; border-radius: .45em; font-style: normal; background: #fff; box-shadow: inset 0 -.2em 0 #dde2e7, 0 .15em .3em rgba(0, 0, 0, .3); }
.bc-die:nth-child(2) { translate: 0 -.5em; }
.bc-die .bc-face { font-size: 1.5em; }
.bc-plate.open .bc-die { animation: pl-pop .45s cubic-bezier(.3, 1.6, .5, 1) both; }
.bc-plate.open .bc-die:nth-child(2) { animation-delay: .1s; }
.bc-plate.open .bc-die:nth-child(3) { animation-delay: .2s; }
.bc-bowl { position: absolute; left: 50%; bottom: .8em; width: 10.6em; height: 7em; margin-left: -5.3em; border-radius: 50% 50% 46% 46% / 64% 64% 36% 36%; transition: transform .7s cubic-bezier(.4, 0, .3, 1), opacity .6s .15s;
  background: radial-gradient(ellipse at 32% 22%, rgba(255, 255, 255, .9) 0 8%, transparent 26%), linear-gradient(transparent 60%, #1f4f9a 60% 65%, transparent 65% 71%, #1f4f9a 71% 73%, transparent 73%), radial-gradient(circle at 50% 38%, #1f4f9a 0 .55em, transparent .6em), linear-gradient(90deg, #cfd8e3, #fbfcfd 40%, #e4e9f0 75%, #b8c2ce);
  box-shadow: 0 .5em 1em -.3em rgba(0, 0, 0, .45); }
.bc-plate.open .bc-bowl { transform: translate(-3.5em, -4.5em) rotate(-24deg); opacity: 0; }
.bc-plate.shaking { animation: bc-shake .13s ease-in-out infinite alternate; }
@keyframes bc-shake { from { transform: translate(-.5em, -.15em) rotate(-4deg); } to { transform: translate(.5em, .1em) rotate(4deg); } }
.bc-res { display: flex; flex-direction: column; gap: .3em; width: min(19em, 100%); min-height: 1em; margin: 0; padding: 0; list-style: none; }
.bc-res li { display: flex; align-items: center; gap: .55em; padding: .4em .75em; border-radius: .7em; font-size: .84em; line-height: 1.35; color: #2f2a3a; background: color-mix(in srgb, var(--paper, #fff) 92%, transparent); box-shadow: 0 .3em .8em -.4em rgba(0, 0, 0, .3); animation: pl-up .5s ease both; }
.bc-res li .bc-face { flex: none; font-size: 1.45em; }
.bc-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: .5em; }
.bc-foot:empty { display: none; }

/* ---------- 5. hái lộc ---------- */
.hl-tree { position: relative; width: 20em; height: 14em; margin-bottom: 2em; }
.hl-branch { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hl-branch path { fill: none; stroke: #5b3a1e; stroke-width: .3em; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.hl-branch path:first-child { stroke-width: .6em; stroke: #4a2e16; }
.hl-fl { position: absolute; font-style: normal; font-size: 1.2em; line-height: 1; translate: -50% -50%; pointer-events: none; animation: hl-sway 3.2s ease-in-out infinite alternate; animation-delay: calc(var(--d) * -3); }
@keyframes hl-sway { to { rotate: 18deg; } }
.hl-tree.bloom .hl-fl { animation: hl-bloom .9s var(--d) cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes hl-bloom { 0% { transform: scale(1); } 60% { transform: scale(1.9) rotate(40deg); } 100% { transform: scale(1.45) rotate(25deg); } }
.hl-tag { position: absolute; width: 3.1em; height: calc(var(--len, 1.2em) + 3.9em); margin-left: -1.55em; padding: 0; border: 0; background: none; cursor: pointer; transform-origin: 50% 0; animation: hl-swing 2.4s ease-in-out infinite alternate; animation-delay: var(--d); }
@keyframes hl-swing { from { rotate: -7deg; } to { rotate: 7deg; } }
.hl-str { position: absolute; left: 50%; top: 0; width: .08em; height: calc(var(--len, 1.2em) + .2em); margin-left: -.04em; background: var(--accent2); }
.hl-tag b { position: absolute; left: 0; right: 0; bottom: 0; height: 4.9em; display: grid; place-items: center; padding: .2em; border-radius: .4em;
  font-family: var(--tf); font-weight: 400; font-size: .8em; line-height: 1.05; color: #ffe39a; text-align: center; overflow-wrap: break-word; hyphens: none;
  background: linear-gradient(color-mix(in srgb, var(--accent) 80%, #c1121f), color-mix(in srgb, var(--accent) 70%, #5c0000)); box-shadow: inset 0 0 0 .13em var(--accent2), 0 .3em .5em -.2em rgba(0, 0, 0, .5); }
.hl-tag b::after { content: ''; position: absolute; left: 50%; bottom: -.1em; width: .5em; height: .5em; margin-left: -.25em; border-radius: 50%; background: var(--accent2); }
.hl-tag.picked { animation: hl-pick .6s ease-in forwards; pointer-events: none; }
@keyframes hl-pick { 30% { transform: translateY(-.6em) scale(1.15); } 100% { transform: translateY(5em) scale(.3); opacity: 0; } }
.hl-card { width: min(18.5em, 100%); min-height: 6.2em; padding: .75em 1.1em .85em; border-radius: .9em; text-align: center; color: #2f2a3a; visibility: hidden;
  background: #fffdf5; box-shadow: inset 0 0 0 .12em var(--accent2), 0 .6em 1.4em -.6em rgba(0, 0, 0, .45); }
.hl-card.show { visibility: visible; animation: hl-flip .6s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes hl-flip { from { transform: perspective(30em) rotateY(90deg); opacity: 0; } }
.hl-card small { display: block; font-size: .64em; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; opacity: .6; }
.hl-card b { display: block; font-family: var(--tf); font-weight: 400; font-size: 1.45em; line-height: 1.15; color: var(--accent-deep, var(--accent)); }
.hl-card p { margin: .2em 0 0; font-size: .9em; line-height: 1.4; text-wrap: balance; }
.hl-foot { display: flex; justify-content: center; }
.hl-foot:empty { display: none; }

/* ---------- 6. sớ Táo quân ---------- */
.tq-scroll { position: relative; width: min(19.5em, 100%); overflow: auto; padding: .9em 1.15em .8em; color: #3b1d10; scrollbar-width: none;
  background: radial-gradient(ellipse at 30% 10%, rgba(255, 255, 255, .55), transparent 50%), linear-gradient(#fbf0d4, #f1dcae); box-shadow: inset 0 0 0 .3em #fbf0d4, inset 0 0 0 .38em #a61e1e, 0 1em 2em -.7em rgba(0, 0, 0, .5);
  animation: tt-unroll 1s cubic-bezier(.2, .8, .3, 1) both; }
.tq-rod { display: block; height: .5em; margin: -.55em -.7em .6em; border-radius: .3em; background: linear-gradient(#c2873f, #6b3a12); }
.tq-rod.bot { margin: .55em -.7em -.45em; }
.tq-head { text-align: center; }
.tq-head small { display: block; font-size: .64em; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: #a61e1e; }
.tq-head b { display: block; margin: .1em 0 .3em; font-family: var(--tf); font-weight: 400; font-size: 1.4em; line-height: 1.15; color: #7a1414; text-wrap: balance; }
.tq-list { margin: 0; padding: 0; list-style: none; }
.tq-row { border-top: 1px dashed rgba(122, 20, 20, .35); animation: pl-up .5s ease both; }
.tq-item { position: relative; display: grid; grid-template-columns: 4.6em 1fr; gap: .5em; align-items: baseline; width: 100%; padding: .45em 2.4em .45em .2em; border: 0; border-radius: .4em; background: none; color: inherit; text-align: left; cursor: pointer; transition: background .2s; }
.tq-item:not(.ok):hover { background: rgba(166, 30, 30, .07); }
.tq-item b { font-size: .68em; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; color: #a61e1e; }
.tq-item span { font-size: .84em; line-height: 1.38; }
.tq-stamp { position: absolute; right: .1em; top: 50%; margin-top: -.85em; padding: .15em .4em; border: .15em solid #d6336c; border-radius: .3em; font-style: normal; font-size: .66em; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: #d6336c; rotate: -14deg; opacity: 0; transform: scale(2.3); mix-blend-mode: multiply; }
.tq-item:not(.ok) .tq-stamp { border-style: dashed; color: rgba(166, 30, 30, .35); border-color: rgba(166, 30, 30, .3); opacity: 1; transform: none; rotate: 0deg; mix-blend-mode: normal; }
.tq-item.ok .tq-stamp { opacity: .92; transform: none; transition: transform .3s cubic-bezier(.3, 1.6, .5, 1), opacity .2s; }
.tq-sign { margin: .5em 0 0; text-align: right; font-family: var(--tf); font-size: 1em; color: #7a1414; }
.tq-scroll.nudge { animation: tq-nudge .45s ease; }
@keyframes tq-nudge { 20%, 60% { transform: translateX(-.4em); } 40%, 80% { transform: translateX(.4em); } }
.tq-scroll.away { animation: tq-away 1.1s ease-in forwards; }
@keyframes tq-away { to { transform: translateY(-4em) scale(.5); opacity: 0; } }
.tq-pond { position: relative; flex: none; width: 13em; height: 4.4em; border-radius: 50%; background: radial-gradient(ellipse at 50% 35%, #8fd3ff, #2b8ad8 62%, #17589a); box-shadow: inset 0 .3em .7em rgba(0, 0, 0, .3), 0 .4em .8em -.4em rgba(0, 0, 0, .4); }
.tq-carp { position: absolute; left: 50%; top: 50%; width: 1.4em; height: 1.4em; margin: -.7em 0 0 -.7em; display: grid; place-items: center; padding: 0; border: 0; background: none; font-size: 2.3em; line-height: 1; cursor: pointer; animation: tq-swim 2.6s ease-in-out infinite alternate; }
.tq-carp > span { grid-area: 1 / 1; transition: opacity .4s; }
.tq-dragon { opacity: 0; }
.tq-pond:not(.ready) .tq-carp { filter: saturate(.6); }
.tq-pond.ready .tq-carp { animation: tq-swim 2.6s ease-in-out infinite alternate, tt-pulse 1.4s ease-in-out infinite; }
@keyframes tq-swim { from { transform: translateX(-2.2em) rotate(-8deg); } to { transform: translateX(2.2em) rotate(8deg); } }
.tq-pond.fly .tq-carp { animation: tq-leap 2.2s cubic-bezier(.4, 0, .5, 1) forwards; }
.tq-pond.fly .tq-fish { opacity: 0; transition-delay: .7s; }
.tq-pond.fly .tq-dragon { opacity: 1; transition-delay: .7s; }
@keyframes tq-leap { 0% { transform: none; } 35% { transform: translateY(-3.5em) rotate(-25deg) scale(1.2); } 100% { transform: translate(1.5em, -13em) rotate(-10deg) scale(2); opacity: 0; } }
.tq-cloud { position: absolute; top: -.5em; font-style: normal; font-size: 1.6em; opacity: 0; pointer-events: none; }
.tq-cloud.a { left: -.6em; }
.tq-cloud.b { right: -.6em; }
.tq-pond.fly .tq-cloud { animation: tq-cloud 2s ease-out .4s both; }
@keyframes tq-cloud { 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-4em) scale(1.6); } }
.tq-foot { display: flex; justify-content: center; }
.tq-foot:empty { display: none; }

/* ---------- 7. hũ điều ước ---------- */
.wj-jar { position: relative; width: 11em; height: 14em; padding: 0; border: 0; background: none; cursor: pointer; transform-origin: 50% 100%; }
.wj-jar:not(.shaking):not(.glow) { animation: tt-pulse 2s ease-in-out infinite; }
.wj-cork { position: absolute; left: 50%; top: 0; z-index: 2; width: 4.6em; height: 1.6em; margin-left: -2.3em; border-radius: .35em .35em .2em .2em; background: linear-gradient(90deg, #9a6232, #d9a066 50%, #8f5a2c); box-shadow: inset 0 -.2em 0 rgba(0, 0, 0, .15); }
.wj-neck { position: absolute; left: 50%; top: 1.3em; z-index: 1; width: 5.6em; height: 1.4em; margin-left: -2.8em; border-radius: .4em; background: rgba(255, 255, 255, .28); box-shadow: inset 0 0 0 .14em rgba(255, 255, 255, .7); }
.wj-glass { position: absolute; left: 0; right: 0; top: 2.4em; bottom: 0; overflow: hidden; border-radius: 2.8em 2.8em 2em 2em;
  background: linear-gradient(90deg, rgba(255, 255, 255, .38), rgba(255, 255, 255, .06) 28% 72%, rgba(255, 255, 255, .3)), color-mix(in srgb, var(--accent2) 16%, rgba(255, 255, 255, .12));
  box-shadow: inset 0 0 0 .16em rgba(255, 255, 255, .7), inset .7em 0 1em rgba(255, 255, 255, .22), 0 1em 2em -1em rgba(0, 0, 0, .55); transition: box-shadow .8s; }
.wj-jar.glow .wj-glass { box-shadow: inset 0 0 0 .16em rgba(255, 255, 255, .8), inset 0 0 2em rgba(255, 240, 180, .6), 0 0 3em .6em color-mix(in srgb, var(--accent2) 65%, transparent); }
.wj-star { position: absolute; font-style: normal; font-size: 2.1em; line-height: 1; color: var(--c); rotate: var(--r); text-shadow: 0 .05em .1em rgba(0, 0, 0, .25); transition: transform .7s cubic-bezier(.4, 0, .4, 1), opacity .6s; }
.wj-star.deco { font-size: 1.6em; opacity: .85; }
.wj-star.out { transform: translateY(-9em) scale(.4); opacity: 0; }
.wj-fly { position: absolute; width: .32em; height: .32em; border-radius: 50%; background: #fff9c4; box-shadow: 0 0 .6em .2em #ffe066; animation: wj-fly 3.4s ease-in-out infinite alternate; animation-delay: var(--d); }
@keyframes wj-fly { 0% { transform: translate(0, 0); opacity: .3; } 50% { opacity: 1; } 100% { transform: translate(1.4em, -1.8em); opacity: .4; } }
.wj-label { position: absolute; left: 50%; top: 34%; z-index: 2; padding: .25em .8em; border-radius: .4em; translate: -50% 0; rotate: -4deg; white-space: nowrap; font-style: normal; font-family: var(--tf); font-size: 1.3em; color: var(--accent-deep, var(--accent)); background: #fffdf5; box-shadow: 0 .2em .5em rgba(0, 0, 0, .25); }
.wj-jar.shaking { animation: wj-shake .15s ease-in-out 6 alternate; }
@keyframes wj-shake { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
.wj-note { width: min(18em, 100%); min-height: 5.4em; padding: .75em 1.1em .85em; border-radius: .8em; text-align: center; color: #2f2a3a; visibility: hidden;
  background: #fffdf5; box-shadow: inset 0 .35em 0 var(--c, var(--accent2)), 0 .6em 1.4em -.6em rgba(0, 0, 0, .45); }
.wj-note.show { visibility: visible; animation: wj-unfold .6s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes wj-unfold { from { transform: translateY(-3em) scale(.3) rotate(-18deg); opacity: 0; } }
.wj-note small { display: block; margin-top: .2em; font-size: .64em; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; opacity: .6; }
.wj-note p { margin: .25em 0 0; font-family: var(--tf); font-size: 1.3em; line-height: 1.25; color: var(--accent-deep, var(--accent)); text-wrap: balance; }
.wj-foot { display: flex; justify-content: center; min-height: 2.6em; }

@media (prefers-reduced-motion: reduce) {
  .hl-tag:not(.picked), .hl-fl, .wj-fly, .tq-pond:not(.fly) .tq-carp { animation: none; }
}
