  :root {
    --night: #070d22;
    --snow: #fbf8f1;
    --red: #c8102e;
    --red-dark: #8f0b21;
    --green: #1f7a3a;
    --gold: #f2c14e;
    --paper: #fdf6e3;
    --ink: #3b2a1a;
    --muted: #8a7a66;
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; }
  html { overflow-x: clip; }
  body {
    min-height: 100vh;
    font-family: "Be Vietnam Pro", system-ui, sans-serif;
    color: var(--snow);
    background: var(--night);
    overflow-x: hidden;
  }

  /* ===== Bầu trời đêm ===== */
  .sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
    background: linear-gradient(180deg, #050a1f 0%, #0d1840 35%, #23285e 62%, #4a3460 82%, #6b3d55 100%); }
  .aurora { position: absolute; border-radius: 50%; filter: blur(70px); mix-blend-mode: screen; opacity: .55; }
  .aurora.a1 { width: 70vw; height: 30vh; left: -10vw; top: 6vh; background: #1fd6a0; animation: drift1 22s ease-in-out infinite alternate; }
  .aurora.a2 { width: 60vw; height: 26vh; right: -15vw; top: 14vh; background: #7a5cff; animation: drift2 26s ease-in-out infinite alternate; }
  .aurora.a3 { width: 50vw; height: 22vh; left: 25vw; top: 0; background: #ff5fa2; opacity: .3; animation: drift1 30s ease-in-out infinite alternate-reverse; }
  @keyframes drift1 { from { transform: translate(0,0) scale(1) rotate(-8deg); } to { transform: translate(18vw, 4vh) scale(1.25) rotate(6deg); } }
  @keyframes drift2 { from { transform: translate(0,0) scale(1.1) rotate(10deg); } to { transform: translate(-22vw, 6vh) scale(.9) rotate(-4deg); } }
  .moon { position: absolute; top: 7vh; right: 8vw; width: 92px; height: 92px; border-radius: 50%;
    background: radial-gradient(circle at 38% 35%, #fffbe8 0%, #f6ecc4 55%, #e2d29c 100%);
    box-shadow: 0 0 40px 12px rgba(255,240,190,.45), 0 0 120px 40px rgba(255,220,150,.18); }
  .moon::before, .moon::after { content: ""; position: absolute; border-radius: 50%; background: rgba(190,170,110,.35); }
  .moon::before { width: 18px; height: 18px; left: 52px; top: 22px; }
  .moon::after { width: 12px; height: 12px; left: 28px; top: 56px; }
  .shooting { position: absolute; top: 10vh; left: 70vw; width: 140px; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, rgba(255,255,255,0), #fff); opacity: 0; transform: rotate(-25deg);
    animation: shoot 11s linear infinite 3s; }
  .shooting.s2 { top: 22vh; left: 35vw; animation-delay: 8s; animation-duration: 14s; }
  @keyframes shoot { 0% { opacity: 0; transform: rotate(-25deg) translateX(0); } 1% { opacity: 1; }
    6% { opacity: 0; transform: rotate(-25deg) translateX(-420px); } 100% { opacity: 0; transform: rotate(-25deg) translateX(-420px); } }
  #fx { position: absolute; inset: 0; width: 100%; height: 100%; }
  .village { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 26vh; min-height: 150px; }
  .window { animation: flicker 3.5s ease-in-out infinite; }
  @keyframes flicker { 0%,100% { opacity: 1; } 45% { opacity: .78; } 50% { opacity: .95; } 70% { opacity: .82; } }
  .smoke { fill: rgba(255,255,255,.18); animation: smoke 6s ease-out infinite; transform-box: fill-box; }
  @keyframes smoke { from { transform: translateY(0) scale(.6); opacity: .6; } to { transform: translateY(-40px) scale(1.6); opacity: 0; } }

  main { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 26px 16px 32vh; text-align: center; }
  h1 {
    font-family: "Dancing Script", cursive; font-weight: 700; font-size: clamp(48px, 10vw, 82px); margin: 6px 0 0; line-height: 1.05;
    background: linear-gradient(100deg, #f7d77a 0%, #fff6d8 25%, #f2c14e 45%, #fff1c4 65%, #e8a93a 100%);
    background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 3px 0 rgba(120,20,30,.7)) drop-shadow(0 0 18px rgba(255,200,90,.45));
    animation: shimmer 6s linear infinite;
  }
  @keyframes shimmer { from { background-position: 0% 0; } to { background-position: 220% 0; } }
  .sub { margin: 6px 0 16px; color: #dfe4f5; font-size: 15px; }
  .info { display: inline-flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 16px; }
  .chip { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 6px 14px; font-size: 13px; backdrop-filter: blur(6px); }

  .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 2px 0 6px; }
  button { font-family: inherit; cursor: pointer; }
  .btn {
    border: 0; border-radius: 14px; padding: 12px 18px; font-size: 15px; font-weight: 700;
    color: #fff; background: linear-gradient(180deg, #e0243f, var(--red)); box-shadow: 0 4px 0 var(--red-dark), 0 8px 22px rgba(200,16,46,.35);
    transition: transform .1s, filter .2s;
  }
  .btn:hover { filter: brightness(1.08); }
  .btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--red-dark); }
  .btn.green { background: linear-gradient(180deg, #2b9a4d, var(--green)); box-shadow: 0 4px 0 #11502a, 0 8px 22px rgba(31,122,58,.35); }
  .btn.gold { background: linear-gradient(180deg, #ffd56e, #e9a92c); color: #4a2a00; box-shadow: 0 4px 0 #a07a1f, 0 8px 22px rgba(240,180,60,.35); }
  .btn.ghost { background: transparent; color: var(--ink); box-shadow: none; border: 1.5px solid #d9c9a8; }
  .btn[disabled] { opacity: .55; cursor: not-allowed; }
  .lock-note { font-size: 13px; color: #ffe3a3; margin: 10px auto 0; max-width: 460px; }

  /* ===== Cây thông ===== */
  .stage { position: relative; max-width: 560px; margin: 34px auto 0; }
  .halo { position: absolute; left: 50%; top: 48%; width: 120%; aspect-ratio: 1; transform: translate(-50%,-50%);
    background: radial-gradient(circle, rgba(255,196,110,.35) 0%, rgba(255,160,80,.12) 35%, rgba(0,0,0,0) 65%);
    animation: breathe 5s ease-in-out infinite; pointer-events: none; }
  @keyframes breathe { 0%,100% { opacity: .8; transform: translate(-50%,-50%) scale(1); } 50% { opacity: 1; transform: translate(-50%,-50%) scale(1.06); } }
  .tree-wrap { position: relative; width: 100%; aspect-ratio: 400 / 520; }
  .tree-wrap > svg.tree { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
  .rays { transform-origin: 200px 40px; animation: spin 24s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .star-glow { transform-origin: 200px 40px; animation: pulse 2.6s ease-in-out infinite; }
  @keyframes pulse { 0%,100% { opacity: .75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.18); } }
  .bulb { animation: twinkle 2.4s ease-in-out infinite; }
  @keyframes twinkle { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
  .sock-btn {
    position: absolute; transform: translate(-50%, -8%); background: none; border: 0; padding: 0;
    transform-origin: 50% 0; animation: sway 3.4s ease-in-out infinite;
    filter: drop-shadow(0 4px 4px rgba(0,0,0,.45)); transition: filter .2s;
  }
  .sock-btn:hover, .sock-btn:focus-visible { filter: drop-shadow(0 0 10px rgba(255,230,150,1)); outline: none; z-index: 2; }
  .sock-btn svg { width: 100%; height: auto; display: block; }
  @keyframes sway { 0%,100% { rotate: -6deg; } 50% { rotate: 6deg; } }
  .empty-note { color: #e6e9f5; font-size: 14px; margin-top: 4px; }

  /* ===== Hộp thoại ===== */
  .overlay {
    position: fixed; inset: 0; z-index: 10; background: rgba(5,10,26,.72); backdrop-filter: blur(4px);
    display: none; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 24px 12px;
  }
  .overlay.show { display: flex; }
  .card {
    position: relative; width: 100%; max-width: 520px; margin: auto; text-align: left;
    background: var(--paper); color: var(--ink); border-radius: 18px; padding: 22px 20px 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 0 6px rgba(255,255,255,.06); animation: pop .25s ease-out;
  }
  @keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
  .close { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 26px; color: var(--muted); line-height: 1; padding: 6px; }
  .card h2 { margin: 0 0 6px; font-size: 20px; }
  .card p { margin: 6px 0; line-height: 1.55; }
  .letter {
    background: repeating-linear-gradient(to bottom, transparent 0 31px, #e9dcbf 31px 32px), var(--paper);
    border: 1px solid #ead9b5; border-radius: 12px; padding: 16px 16px 10px; margin: 10px 0;
  }
  .script { font-family: "Dancing Script", cursive; font-size: 26px; font-weight: 700; color: var(--red-dark); }
  .line { font-size: 16px; line-height: 32px; margin: 0; }
  .field {
    font-family: inherit; font-size: 16px; color: var(--ink); width: 100%;
    border: 0; border-bottom: 1.5px dashed #b89c6a; background: transparent; padding: 4px 2px; outline: none;
  }
  .field:focus { border-bottom-color: var(--red); background: rgba(255,255,255,.5); }
  .name-row { display: flex; align-items: baseline; gap: 8px; }
  .name-row .field { flex: 1; font-weight: 700; }
  .note { font-size: 13px; color: #8a5a00; background: #fff2cc; border-radius: 8px; padding: 6px 10px; margin: 6px 0 4px; line-height: 1.45; }
  .wish-row { display: flex; align-items: baseline; gap: 8px; }
  .wish-row span { font-weight: 700; color: var(--red-dark); }
  .picker { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; margin: 12px 0 4px; }
  .preview svg { width: 100%; }
  .label { font-size: 13px; font-weight: 700; color: var(--muted); margin: 4px 0; }
  .swatches, .patterns { display: flex; flex-wrap: wrap; gap: 6px; }
  .swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #cbb991; padding: 0; }
  .swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }
  .pat { border: 1px solid #cbb991; background: #fff; color: var(--ink); border-radius: 999px; padding: 4px 10px; font-size: 13px; }
  .pat[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
  .row-end { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
  .msg { min-height: 20px; font-size: 14px; color: var(--red); margin-top: 8px; }
  .msg.ok { color: var(--green); }
  .masked { display: inline-block; min-width: 150px; height: 22px; vertical-align: middle; border-radius: 4px;
    background: repeating-linear-gradient(45deg, #3b2a1a 0 6px, #55402c 6px 12px); }
  .wish-list { margin: 0; padding-left: 0; list-style: none; }
  .wish-list li { font-size: 17px; line-height: 32px; }
  .wish-list li::before { content: "★ "; color: #e0a82e; }
  .shake { display: block; width: 120px; margin: 10px auto; animation: shake .5s ease-in-out 3; }
  @keyframes shake { 0%,100% { rotate: 0deg; } 25% { rotate: -12deg; } 75% { rotate: 12deg; } }
  .center { text-align: center; }
  .reveal { animation: unfold .6s ease-out; transform-origin: top; }
  @keyframes unfold { from { transform: scaleY(.1); opacity: 0; } to { transform: none; opacity: 1; } }
  footer { margin-top: 14px; font-size: 13px; color: #e6e9f5; text-shadow: 0 1px 4px rgba(0,0,0,.6); }

  /* ===== Đếm ngược ===== */
  .countdown { display: inline-block; margin: 2px auto 16px; padding: 10px 16px 12px; border-radius: 16px;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(6px); }
  .countdown .cd-title { font-size: 13px; color: #ffe3a3; margin-bottom: 6px; }
  .cd-boxes { display: flex; gap: 8px; justify-content: center; }
  .cd-box { min-width: 58px; padding: 6px 4px; border-radius: 10px; background: rgba(5,10,30,.45); }
  .cd-box b { display: block; font-size: 24px; line-height: 1.1; color: #fff; font-variant-numeric: tabular-nums; }
  .cd-box span { font-size: 11px; color: #c9d4ea; }

  /* ===== Tim, ngôi sao, hộp quà ===== */
  .sock-btn.loved { filter: drop-shadow(0 0 6px rgba(255,210,120,.95)) drop-shadow(0 0 14px rgba(255,150,170,.7)); }
  .sock-btn .badge { position: absolute; top: -6px; right: -10px; font-size: 10px; font-weight: 700; color: #fff;
    background: #e0245e; border-radius: 999px; padding: 1px 5px; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
  .heart-btn { border: 1.5px solid #f3b5c6; background: #fff; color: #c2185b; border-radius: 999px; padding: 8px 16px; font-size: 15px; font-weight: 700; }
  .heart-btn[aria-pressed="true"] { background: #ffe0ea; }
  .heart-btn.pop { animation: heartpop .4s ease-out; }
  @keyframes heartpop { 50% { transform: scale(1.25); } }
  .star-btn { position: absolute; left: 50%; top: 7.7%; width: 16%; aspect-ratio: 1; transform: translate(-50%,-50%);
    border: 0; border-radius: 50%; background: transparent; z-index: 3; }
  .star-btn:focus-visible { outline: 2px dashed #ffe3a3; }
  .tap-hint { position: absolute; left: 100%; top: 50%; transform: translate(4px,-50%); font-size: 12px; color: #ffe3a3; white-space: nowrap;
    animation: blink 1.4s ease-in-out infinite; pointer-events: none; }
  @keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
  .gift { cursor: pointer; transform-box: fill-box; transform-origin: 50% 100%; animation: wiggle 5s ease-in-out infinite; }
  .gift:hover { filter: brightness(1.15); }
  @keyframes wiggle { 0%,86%,100% { transform: rotate(0); } 89% { transform: rotate(-6deg); } 92% { transform: rotate(6deg); } 95% { transform: rotate(-3deg); } }
  #boom { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 20; pointer-events: none; }
  .gift-card { overflow: hidden; }
  .cats { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0 4px; }
  .cat { border: 1.5px solid #e2d3b3; background: #fff; color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: 14px; }
  .cat[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); transform: scale(1.05); }
  .box3 { position: relative; width: 140px; height: 140px; margin: 18px auto 4px; cursor: pointer; animation: float 2.4s ease-in-out infinite; outline: none; }
  .box3:focus-visible { outline: 2px dashed var(--red); border-radius: 12px; }
  @keyframes float { 50% { transform: translateY(-8px); } }
  .box3 .body { position: absolute; left: 14px; bottom: 6px; width: 112px; height: 78px; border-radius: 6px;
    background: linear-gradient(90deg, transparent 46px, #f2c14e 46px 66px, transparent 66px), linear-gradient(180deg, #e0243f, #9e0c25);
    box-shadow: 0 10px 18px rgba(120,10,30,.35); }
  .box3 .lid { position: absolute; left: 6px; top: 40px; width: 128px; height: 28px; border-radius: 6px; z-index: 2;
    background: linear-gradient(90deg, transparent 54px, #f2c14e 54px 74px, transparent 74px), linear-gradient(180deg, #f0354f, #c8102e);
    box-shadow: 0 4px 6px rgba(0,0,0,.2); transition: transform .7s cubic-bezier(.2,.8,.3,1), opacity .7s; }
  .box3 .bow { position: absolute; left: 50%; top: 18px; width: 70px; height: 26px; transform: translateX(-50%); z-index: 3; transition: transform .7s cubic-bezier(.2,.8,.3,1), opacity .7s; }
  .box3 .bow::before, .box3 .bow::after { content: ""; position: absolute; top: 0; width: 32px; height: 24px; border: 7px solid #f2c14e; border-radius: 50% 50% 10% 50%; }
  .box3 .bow::before { left: 0; transform: rotate(-20deg); }
  .box3 .bow::after { right: 0; transform: scaleX(-1) rotate(-20deg); }
  .box3 .glow { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; border-radius: 50%; transform: translate(-50%,-50%) scale(0);
    background: radial-gradient(circle, #fff7d1 0%, rgba(255,215,110,.8) 35%, rgba(255,215,110,0) 70%); transition: transform .8s ease-out, opacity .8s; }
  .box3.wobble { animation: wob .9s ease-in-out; }
  @keyframes wob { 0%,100% { transform: rotate(0); } 15% { transform: rotate(-9deg) scale(1.03); } 30% { transform: rotate(9deg); } 45% { transform: rotate(-7deg) scale(1.06); } 60% { transform: rotate(7deg); } 75% { transform: rotate(-4deg) scale(1.08); } }
  .box3.open .lid { transform: translate(-40px,-120px) rotate(-35deg); opacity: 0; }
  .box3.open .bow { transform: translate(-10%,-150px) rotate(40deg); opacity: 0; }
  .box3.open .glow { transform: translate(-50%,-50%) scale(9); opacity: 0; }
  .tap-me { font-size: 13px; color: var(--muted); animation: blink 1.4s ease-in-out infinite; }
  .cat-badge { display: inline-block; color: #fff; font-weight: 700; font-size: 14px; padding: 6px 14px; border-radius: 999px; margin: 4px 0 10px; animation: pop .4s ease-out; }
  .fortune { position: relative; border-radius: 16px; padding: 22px 18px 16px; margin: 4px 0;
    background: radial-gradient(circle at 50% 0%, #fff9e6, #fdf0cf); border: 2px dashed #e2c47a; animation: rise .6s cubic-bezier(.2,.8,.3,1); }
  @keyframes rise { from { transform: translateY(40px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
  .fortune::before, .fortune::after { content: "✦"; position: absolute; top: 8px; color: #e0a82e; font-size: 14px; }
  .fortune::before { left: 12px; } .fortune::after { right: 12px; }
  .fortune-text { font-family: "Dancing Script", cursive; font-size: 27px; line-height: 1.35; color: var(--red-dark); margin: 0 0 10px; min-height: 72px; }
  .fortune-text.riddle { font-family: inherit; font-size: 18px; font-weight: 700; color: var(--ink); min-height: 0; }
  .lucky { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; font-size: 13px; }
  .lucky span { background: #fff; border: 1px solid #ecd9a8; border-radius: 999px; padding: 4px 10px; }
  .answer { margin-top: 10px; }

  /* ===== Máy nghe nhạc ===== */
  .music { position: fixed; right: 14px; bottom: 14px; z-index: 8; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
  .music-main { display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 999px;
    background: rgba(10,16,40,.75); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(8px); box-shadow: 0 6px 20px rgba(0,0,0,.4); }
  .m-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 18px; display: grid; place-items: center; }
  .m-btn.play { background: linear-gradient(180deg, #ffd56e, #e9a92c); color: #4a2a00; }
  .m-name { max-width: 150px; font-size: 12px; color: #fff; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
  .m-name small { display: block; color: #c9d4ea; font-size: 10px; }
  .playing .m-btn.play { animation: beat 1s ease-in-out infinite; }
  @keyframes beat { 50% { box-shadow: 0 0 0 6px rgba(255,213,110,.25); } }
  .m-list { display: none; background: rgba(10,16,40,.92); border: 1px solid rgba(255,255,255,.2); border-radius: 14px; padding: 6px; min-width: 230px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
  .m-list.show { display: block; }
  .m-list button { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: #fff; padding: 9px 10px; border-radius: 9px; font-size: 14px; }
  .m-list button:hover, .m-list button[aria-current="true"] { background: rgba(255,255,255,.12); }
  .m-list button[aria-current="true"]::after { content: " 🎵"; }
  .m-credit { font-size: 10px; line-height: 1.45; color: #9fb0d0; padding: 6px 10px 2px; }
  .m-list { width: min(290px, calc(100vw - 28px)); }

  /* ===== Tên thương hiệu ===== */
.brand-sub { margin: 2px 0 0; font-size: 13px; letter-spacing: .28em; text-transform: uppercase; color: #ffe3a3; font-weight: 700; }

/* ===== Đổi ngôn ngữ ===== */
.lang { position: fixed; top: 12px; left: 12px; z-index: 40; display: flex; padding: 3px; border-radius: 999px;
  background: rgba(10,16,40,.7); border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(8px); }
.lang button { border: 0; background: transparent; color: #dfe4f5; font-weight: 700; font-size: 12px; padding: 6px 11px; border-radius: 999px; }
.lang button[aria-pressed="true"] { background: #f2c14e; color: #4a2a00; }

/* ===== Thông báo nhỏ ===== */
.toast { position: fixed; left: 50%; top: 16px; z-index: 35; transform: translate(-50%, -140%); max-width: calc(100% - 120px);
  background: rgba(255,248,230,.97); color: var(--ink); font-weight: 700; font-size: 14px; padding: 10px 18px; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); transition: transform .45s cubic-bezier(.2,.8,.3,1), opacity .3s; text-align: center; opacity: 0; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ===== Màn chào: cửa Bắc Cực ===== */
.door-screen { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: radial-gradient(ellipse at 50% 60%, rgba(40,30,70,.9), rgba(5,8,22,.98) 70%); cursor: pointer; transition: opacity .9s ease .9s, visibility 0s 1.8s; outline: none; padding: 16px; }
.door-title { font-family: "Dancing Script", cursive; font-weight: 700; font-size: clamp(54px, 13vw, 92px); line-height: 1;
  background: linear-gradient(100deg, #f7d77a, #fff6d8 30%, #f2c14e 55%, #fff1c4 75%, #e8a93a); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 6s linear infinite;
  filter: drop-shadow(0 3px 0 rgba(120,20,30,.7)) drop-shadow(0 0 18px rgba(255,200,90,.45)); }
.door-sub { color: #ffe3a3; letter-spacing: .28em; text-transform: uppercase; font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.door-frame { position: relative; width: min(72vw, 300px); height: min(52vh, 400px); border-radius: 150px 150px 10px 10px;
  background: #3a2414; padding: 12px 12px 0; box-shadow: 0 0 0 6px #5b3620, 0 0 0 9px #2a180c, 0 30px 60px rgba(0,0,0,.6); perspective: 900px; }
.door-light { position: absolute; inset: 12px 12px 0; border-radius: 138px 138px 4px 4px;
  background: radial-gradient(ellipse at 50% 70%, #fff7d6 0%, #ffd27a 35%, #e8892c 70%, #7a3a10 100%); }
.door { position: absolute; top: 12px; bottom: 0; width: calc(50% - 12px); overflow: hidden;
  background: repeating-linear-gradient(90deg, #7a4a2a 0 22px, #6d4125 22px 24px), #7a4a2a; box-shadow: inset 0 0 0 2px rgba(0,0,0,.25);
  transition: transform 1.3s cubic-bezier(.6,.05,.3,1); transform-style: preserve-3d; }
.d-left { left: 12px; border-radius: 138px 0 0 4px; transform-origin: left center; }
.d-right { right: 12px; border-radius: 0 138px 4px 0; transform-origin: right center; }
.door .panel { position: absolute; left: 16%; right: 16%; height: 26%; border: 3px solid rgba(0,0,0,.25); border-radius: 6px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.06); }
.door .panel:first-child { top: 30%; } .door .panel:nth-child(2) { top: 62%; }
.door .knob { position: absolute; top: 55%; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff4c4, #d9a521 60%, #8a6210); }
.d-left .knob { right: 10px; } .d-right .knob { left: 10px; }
.wreath { position: absolute; left: 50%; top: 22%; width: 74px; height: 74px; transform: translate(-50%,-50%); border-radius: 50%; z-index: 2;
  background: radial-gradient(circle, transparent 42%, #1f7a3a 43%, #2b9a4d 60%, #155c2c 72%, transparent 73%); transition: opacity .4s; }
.wreath::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 20% 40%, #e0243f 4px, transparent 5px), radial-gradient(circle at 78% 30%, #e0243f 4px, transparent 5px), radial-gradient(circle at 60% 85%, #f2c14e 4px, transparent 5px), radial-gradient(circle at 30% 80%, #e0243f 3px, transparent 4px); }
.wreath span { position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); width: 26px; height: 14px; background: #c8102e; border-radius: 4px; }
.snowcap { position: absolute; left: -14px; right: -14px; top: -14px; height: 40px; border-radius: 160px 160px 20px 20px / 60px 60px 20px 20px;
  background: radial-gradient(circle at 12% 70%, #fff 12px, transparent 13px), radial-gradient(circle at 88% 70%, #fff 12px, transparent 13px), linear-gradient(#fff, #e8eefb);
  clip-path: inset(0 0 45% 0 round 160px 160px 0 0); }
.door-tap { color: #fff; font-weight: 700; margin-top: 16px; animation: blink 1.4s ease-in-out infinite; text-align: center; }
.door-screen.opening .d-left { transform: rotateY(-108deg); }
.door-screen.opening .d-right { transform: rotateY(108deg); }
.door-screen.opening .wreath { opacity: 0; }
.door-screen.opening .door-frame { animation: zoomin 1.6s cubic-bezier(.6,.05,.3,1) .5s forwards; }
@keyframes zoomin { to { transform: scale(3.2); opacity: 0; } }
.door-screen.opening { opacity: 0; visibility: hidden; pointer-events: none; }
.door-screen.opening .door-title, .door-screen.opening .door-sub, .door-screen.opening .door-tap { transition: opacity .4s; opacity: 0; }

/* ===== Xe tuần lộc ===== */
.sleigh-layer { position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.sleigh { position: absolute; top: 9vh; left: 0; width: clamp(170px, 26vw, 260px); padding: 0; border: 0; background: none; pointer-events: auto;
  filter: drop-shadow(0 0 10px rgba(255,230,160,.55)); }
.sleigh svg { display: block; width: 100%; height: auto; animation: bobsleigh 1.2s ease-in-out infinite; }
@keyframes bobsleigh { 50% { transform: translateY(-7px) rotate(-1.5deg); } }
.sleigh.fly { animation: flyacross 10s linear forwards; }
@keyframes flyacross { from { transform: translateX(105vw); } to { transform: translateX(-120%); } }
.sleigh.zoom { animation: zoomaway 1.4s ease-in forwards; }
@keyframes zoomaway { to { transform: translate(-60vw, -30vh) scale(.3); opacity: 0; } }
.sleigh .legs { animation: gallop .35s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 0; }
.sleigh .l2 { animation-delay: -.17s; }
@keyframes gallop { to { transform: rotate(14deg); } }
.sleigh .rudolph { animation: blink 1s ease-in-out infinite; }
.sleigh .trail circle { animation: blink .8s ease-in-out infinite; }
.sleigh .trail circle:nth-child(2) { animation-delay: -.2s; } .sleigh .trail circle:nth-child(3) { animation-delay: -.4s; } .sleigh .trail circle:nth-child(4) { animation-delay: -.6s; }
.drop-gift { position: fixed; z-index: 25; font-size: 44px; pointer-events: none; filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); }

/* ===== Lá thư bay ===== */
.envelope { position: fixed; z-index: 25; width: 120px; pointer-events: none; filter: drop-shadow(0 8px 16px rgba(0,0,0,.45)); }
.envelope svg { width: 100%; display: block; }
.spark { position: fixed; z-index: 24; width: 6px; height: 6px; border-radius: 50%; background: #ffe7a0; box-shadow: 0 0 8px #ffd76a; pointer-events: none; }
.new-star { position: absolute; width: 14px; height: 14px; transform: translate(-50%,-50%); animation: twinkle 1.6s ease-in-out infinite; }
.new-star::before { content: "✦"; position: absolute; inset: -6px; font-size: 22px; line-height: 26px; text-align: center; color: #fff6c8; text-shadow: 0 0 10px #ffd76a, 0 0 20px #ffb347; }

/* ===== Quà vô lý từ ông già Noel ===== */
.prize-card { overflow: hidden; background: radial-gradient(circle at 50% 0%, #fff9e6 0%, var(--paper) 55%); }
.prize-stage { position: relative; height: 190px; display: grid; place-items: center; margin: -4px 0 4px; }
.prize-rays { position: absolute; width: 340px; height: 340px; border-radius: 50%;
  background: repeating-conic-gradient(rgba(242,193,78,.38) 0 10deg, rgba(242,193,78,0) 10deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 25%, transparent 68%); mask: radial-gradient(circle, #000 25%, transparent 68%);
  animation: spin 14s linear infinite; }
.prize-disc { position: absolute; width: 150px; height: 150px; border-radius: 50%; opacity: .55; filter: blur(2px); }
.prize-img { position: relative; font-size: 112px; line-height: 1; filter: drop-shadow(0 12px 14px rgba(0,0,0,.28)); }
.prize-img.in { animation: prizein .8s cubic-bezier(.2,1.4,.4,1) both, prizefloat 2.6s ease-in-out .8s infinite; }
@keyframes prizein { from { transform: scale(0) rotate(-30deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes prizefloat { 50% { transform: translateY(-8px) rotate(-3deg); } }
.prize-congrats { font-weight: 800; font-size: 22px; letter-spacing: .12em; color: var(--red); animation: blink 1.2s ease-in-out infinite; }
.prize-intro { margin: 4px 0 2px !important; color: var(--muted); }
.prize-name { font-family: "Dancing Script", cursive; font-size: 30px !important; line-height: 1.2; color: var(--red-dark); margin: 2px 0 8px !important; }
.prize-tag { display: inline-block; padding: 6px 16px; border-radius: 999px; background: linear-gradient(180deg, #ffd56e, #e9a92c); color: #4a2a00; font-size: 15px; box-shadow: 0 3px 0 #a07a1f; }
.prize-note { font-size: 14px; margin: 12px 0 2px !important; }
.prize-fine { font-size: 11px; color: var(--muted); margin: 6px 0 0 !important; }

/* ===== Tất mới treo ===== */
.sock-btn.fresh { filter: drop-shadow(0 0 8px #fff3b0) drop-shadow(0 0 18px #ffd76a); z-index: 2; }

/* ===== Bốc tất kiểu úp ly ===== */
.shuffle { position: relative; height: 150px; margin: 14px 0 6px; }
.mystery { position: absolute; top: 10px; width: 17%; padding: 0; border: 0; background: none; transform: translateX(-50%);
  transition: left .3s cubic-bezier(.5,0,.3,1), transform .35s, opacity .4s, top .3s; filter: drop-shadow(0 6px 6px rgba(0,0,0,.25)); }
.mystery svg { width: 100%; display: block; }
.mystery .q { position: absolute; left: 50%; top: 52%; transform: translate(-50%,-50%); font-weight: 800; font-size: 22px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.mystery.lift { top: -6px; z-index: 2; }
.shuffle.pickable .mystery { cursor: pointer; animation: sway 2.2s ease-in-out infinite; transform-origin: 50% 0; }
.shuffle.pickable .mystery:hover { transform: translateX(-50%) translateY(-8px) scale(1.08); }
.mystery.gone { opacity: 0; transform: translateX(-50%) translateY(30px) scale(.8); pointer-events: none; }
.mystery.chosen { left: 50% !important; transform: translateX(-50%) scale(1.5); z-index: 3; animation: none; }
.peek-wrap { position: relative; width: 120px; margin: 10px auto; }
.peek-wrap .shake { margin: 0; width: 120px; }
.peek { position: absolute; left: 50%; top: 4px; transform: translate(-50%, 0); font-size: 40px; z-index: 0; animation: peekup 1.4s ease-in-out .5s forwards; opacity: 0; }
@keyframes peekup { 0% { transform: translate(-50%, 20px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(-50%, -54px) rotate(-8deg); opacity: 1; } }

/* ===== Cùng thắp sáng cây ===== */
.tree-progress { max-width: 420px; margin: 18px auto 0; padding: 12px 16px 10px; border-radius: 16px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(6px); }
.tp-text { font-size: 14px; margin-bottom: 10px; }
.tp-bar { position: relative; height: 12px; border-radius: 999px; background: rgba(5,10,30,.5); margin: 0 10px; }
.tp-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #2b9a4d, #f2c14e, #fff3c0);
  box-shadow: 0 0 12px rgba(242,193,78,.7); transition: width 1.2s cubic-bezier(.2,.8,.3,1); }
.tp-mark { position: absolute; top: 50%; transform: translate(-50%,-50%); font-size: 16px; filter: grayscale(1) opacity(.6); transition: filter .4s; }
.tp-mark.on { filter: none; }
.tp-next { font-size: 12px; color: #ffe3a3; margin-top: 8px; }
.stage.lvl0 .bulb { opacity: .15; animation: none; }
.stage.lvl0 .halo { opacity: .45; animation: none; }
.goldsnow { position: absolute; inset: 0 0 10% 0; pointer-events: none; display: none; z-index: 1; }
.stage.lvl2 .goldsnow, .stage.lvl3 .goldsnow { display: block; }
.goldsnow i { position: absolute; top: -4%; width: 5px; height: 5px; border-radius: 50%; background: #ffd76a; box-shadow: 0 0 6px #ffcf4a; animation: goldfall linear infinite; }
@keyframes goldfall { from { transform: translateY(0); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } to { transform: translateY(520px); opacity: 0; } }
.stage.lvl3 .star-glow { animation: pulsebig 1.8s ease-in-out infinite; }
@keyframes pulsebig { 0%,100% { opacity: .9; transform: scale(1.4); } 50% { opacity: 1; transform: scale(2.1); } }
.stage.lvl3 .rays { opacity: 1; animation-duration: 10s; }
.stage.lvl3 .halo { background: radial-gradient(circle, rgba(255,215,120,.55) 0%, rgba(255,170,80,.2) 40%, rgba(0,0,0,0) 68%); }

@media (max-width: 520px) { .m-name { max-width: 90px; } .cd-box { min-width: 50px; } .cd-box b { font-size: 20px; } }
  @media (max-width: 520px) { .moon { width: 48px; height: 48px; right: 4vw; top: 2vh; opacity: .9; } .moon::before { left: 27px; top: 11px; width: 9px; height: 9px; } .moon::after { left: 14px; top: 29px; width: 6px; height: 6px; } }
  @media (max-width: 520px) { .sleigh { top: 5vh; } .tree-progress { margin-top: 14px; } }
.cd-short { display: none; }
@media (max-width: 520px) {
  h1 { font-size: 46px; }
  .brand-sub { font-size: 11px; }
  .sub { font-size: 14px; margin: 4px 0 10px; }
  .info { gap: 6px; margin-bottom: 10px; }
  .chip { font-size: 12px; padding: 4px 10px; }
  .countdown { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; margin-bottom: 10px; }
  .countdown .cd-title { margin: 0; font-size: 11px; max-width: 76px; text-align: left; line-height: 1.3; }
  .cd-long { display: none; } .cd-short { display: inline; }
  .cd-boxes { gap: 4px; }
  .cd-box { min-width: 40px; padding: 3px 2px; } .cd-box b { font-size: 16px; } .cd-box span { font-size: 9px; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .actions .btn { padding: 10px 6px; font-size: 13px; }
  .actions #openDraw { grid-column: 1 / -1; }
  .lock-note { font-size: 11.5px; margin-top: 8px; }
  .tree-progress { margin-top: 10px; padding: 8px 12px; }
  .tp-text { font-size: 12.5px; margin-bottom: 6px; } .tp-next { font-size: 11px; margin-top: 4px; }
  .stage { margin-top: 14px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }
