/* 🎅 Giao quà Noel (public/js/tro-nha-noel.js) — troi dem, tuyet roi, 3 ngoi nha, xe tuan loc bay ngang.
   Net ve dam #2b1d3a + bong lech, cung kieu cac tro khac cua Sân chơi. */
.tn-noel .tn-san { padding: 0; min-height: 0; display: block; }
.tn-ng-de { font-size: 0.95rem; font-weight: 600; }
.tn-ng-canh {
  position: relative; overflow: hidden; width: 100%; max-width: 620px; margin: 0 auto;
  height: clamp(380px, 68vh, 520px); border-radius: 20px; border: 3px solid #2b1d3a;
  background: linear-gradient(180deg, #14204d 0%, #27306f 48%, #4a3f8a 78%, #6a4f9a 100%);
  box-shadow: 0 6px 0 rgba(43, 29, 58, 0.35); touch-action: manipulation; user-select: none;
}
.tn-ng-trang {
  position: absolute; top: 18px; right: 22px; width: 46px; height: 46px; border-radius: 50%;
  background: #fff6cf; box-shadow: 0 0 0 8px rgba(255, 246, 207, 0.12), 0 0 30px rgba(255, 246, 207, 0.5);
}
.tn-ng-trang::after { content: ''; position: absolute; left: 12px; top: 10px; width: 9px; height: 9px; border-radius: 50%; background: rgba(214, 200, 150, 0.6); box-shadow: 14px 12px 0 -2px rgba(214, 200, 150, 0.5); }

/* tuyet roi */
.tn-ng-tuyet { position: absolute; inset: 0; pointer-events: none; }
.tn-ng-tuyet i { position: absolute; top: -10px; border-radius: 50%; background: #fff; animation: tn-ng-roi linear infinite; }
@keyframes tn-ng-roi { to { transform: translate3d(24px, 560px, 0); } }

/* xe tuan loc + the qua */
.tn-ng-xe { position: absolute; top: 9%; left: -34%; width: 34%; min-width: 150px; z-index: 3; pointer-events: none; animation: tn-ng-nhun 1.2s ease-in-out infinite; }
@keyframes tn-ng-nhun { 50% { margin-top: 8px; } }
.tn-ng-xe-h { display: block; width: 100%; height: auto; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.25)); }
.tn-ng-the {
  position: absolute; left: 6%; top: 88%; width: max-content; max-width: min(240px, 62vw); white-space: normal; text-align: center;
  padding: 6px 14px; border-radius: 14px; border: 3px solid #2b1d3a; background: #fffdf6; color: #2b1d3a;
  font-weight: 800; font-size: 1.05rem; line-height: 1.25; box-shadow: 0 4px 0 #2b1d3a;
}
.tn-ng-the::before { /* soi day treo the */
  content: ''; position: absolute; left: 22px; top: -14px; width: 3px; height: 14px; background: #f6c24a;
}
.tn-ng-the::after { /* no tren the qua */
  content: ''; position: absolute; right: -10px; top: -10px; width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff8a7a 0 25%, #c8372d 26%); border: 2.5px solid #2b1d3a;
}
.tn-ng-the.la-zh { font-family: 'Noto Serif SC', serif; font-size: clamp(1.6rem, 6vw, 2.1rem); padding: 4px 16px; letter-spacing: 0.05em; }

/* lang: 3 ngoi nha */
.tn-ng-lang { position: absolute; left: 0; right: 0; bottom: 6%; display: flex; justify-content: space-around; align-items: flex-end; gap: 6px; padding: 0 6px; z-index: 2; }
.tn-ng-nha {
  flex: 1 1 0; max-width: 180px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 0; border: 0; background: none; cursor: pointer; color: #2b1d3a; font: inherit;
  -webkit-tap-highlight-color: transparent;
}
.tn-ng-nha-h { width: 100%; max-width: 128px; height: auto; display: block; transition: transform 0.15s; }
.tn-ng-nha:active .tn-ng-nha-h { transform: translateY(3px) scale(0.97); }
.tn-ng-nha:focus-visible { outline: 3px solid #f6c24a; outline-offset: 4px; border-radius: 12px; }
.tn-ng-nha[disabled] { opacity: 0.4; cursor: default; }
.tn-ng-bien {
  display: block; width: 100%; min-height: 48px; padding: 6px 6px; border-radius: 12px;
  border: 3px solid #2b1d3a; background: #fff2cf; box-shadow: 0 3px 0 #2b1d3a;
  font-weight: 800; font-size: 0.92rem; line-height: 1.25; text-align: center;
  display: flex; align-items: center; justify-content: center; overflow-wrap: anywhere;
}
.tn-ng-bien.la-zh { font-family: 'Noto Serif SC', serif; font-size: clamp(1.25rem, 5vw, 1.6rem); font-weight: 700; }
.tn-ng-khoi { opacity: 0; }
.tn-ng-nha.dung .tn-ng-cs { fill: #ffd45e; }
.tn-ng-nha.dung .tn-ng-khoi { opacity: 1; animation: tn-ng-khoi 0.9s ease-out; }
@keyframes tn-ng-khoi { from { transform: translateY(6px); opacity: 0; } 40% { opacity: 1; } to { transform: translateY(-6px); opacity: 0.2; } }
.tn-ng-nha.dung .tn-ng-bien { background: #c9f0d8; border-color: #2f8f6a; }
.tn-ng-nha.sai .tn-ng-bien { background: #ffd2cc; border-color: #c8372d; animation: tn-ng-lac 0.35s; }
.tn-ng-nha.mo .tn-ng-bien { background: #c9f0d8; border-style: dashed; }
@keyframes tn-ng-lac { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* mat dat tuyet */
.tn-ng-dat { position: absolute; left: -4%; right: -4%; bottom: -18px; height: 16%; border-radius: 50% 50% 0 0 / 40% 40% 0 0; background: #f4f6ff; border-top: 3px solid #2b1d3a; z-index: 1; }

/* hop qua roi */
.tn-ng-qua {
  position: absolute; width: 28px; height: 26px; z-index: 4; border-radius: 4px; border: 3px solid #2b1d3a;
  background: linear-gradient(90deg, transparent 40%, #f6c24a 40% 60%, transparent 60%), linear-gradient(0deg, transparent 40%, #f6c24a 40% 60%, transparent 60%), #2f8f6a;
  pointer-events: none;
}

@media (max-width: 420px) {
  .tn-ng-bien { font-size: 0.8rem; min-height: 44px; padding: 4px; }
  .tn-ng-the { font-size: 0.92rem; }
}
