@charset "UTF-8";
@import url("vn_font_global.css");

/* =======================
   BASE (giữ cấu trúc cũ)
   ======================= */

body {
  background-image: url('../img/bg/bghomenoel4.png');
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;   /* QUAN TRỌNG: fill full màn hình */
  background-attachment: fixed; /* tùy chọn: giúp hình đứng yên khi scroll */
  background-color: #f5f5f5; /* fallback khi ảnh chưa load */
  font-family: 'Inter', 'Roboto', Arial, sans-serif;
  min-height: 100vh; /* đảm bảo body luôn cao >= chiều cao màn hình */
}


.custom-navbar {
  background: url('../img/bg/bghead9a.jpg') center center/cover no-repeat, #e7ecf3 !important;
  min-height: 62px;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 2px 8px #e2e6ed;
  color: blue;
}
.navbar-brand { color: #000088 !important; }
.navbar-brand:hover { color: #fd5a36; }

.wrapper-main { display: flex; gap: 0; min-height: 100vh; }

/* Giảm khoảng cách dưới của tiêu đề */
.section-title-christmas {
    
    margin-bottom: 6px;   /* sát hơn thay vì mb-4 (~1.5rem) */
}

/* Kéo mosaic sát lên dưới chữ – nếu vẫn còn hở nhiều có thể dùng margin-top âm */
/* Mặc định */
.mosaic-wrap{
  margin-top: 0;
}

/* Có tiêu đề → đẩy mosaic xuống */
body.has-home-title .mosaic-wrap{
  padding-top: 2px;   /* chỉnh 10–24px theo ý */
}

/* Không có tiêu đề → không cần đẩy */
body.no-home-title .mosaic-wrap{
  padding-top: 0;
}

/* KHOẢNG CÁCH giữa title và Mosaic */
.section-title-christmas{
  margin-bottom: 2px;   /* tăng lên chút để không chạm */
}

/* Mosaic nằm thấp xuống (không dùng margin âm) */
.mosaic-wrap{
  margin-top: 0;         /* ✅ bỏ -30px */
  padding-top: 3px;     /* ✅ đẩy mosaic xuống nhẹ */
}
.sidebar {
  width: 330px;
  background: url('../img/bg/bghead7.gif') center center/cover no-repeat, #e7ecf3 !important;
  padding: 28px 20px 16px 20px;
  min-height: 100vh;
  border-radius: 0 14px 14px 0;
  box-shadow: 1px 0 8px #f1f1f1;
  transition: width 0.2s;
}
.main { flex: 1; padding: 32px; min-width: 0; }

.stat-card, .admin-section {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 8px #ececec;
  padding: 20px 20px 10px 20px;
  margin-bottom: 28px;
}
.stat-card .big-num { font-size: 2.3rem; font-weight: bold; margin-bottom: 6px; color: #d33439; }
.stat-card .label-small { font-size: 1.05rem; margin-bottom: 2px; }
.stat-card .card-title { font-size: 1.15rem; font-weight: 500; margin-bottom: 10px; color: #333; letter-spacing: 0.3px; }

#imagePreview img {
  max-width:120px; margin-top:12px; border-radius:10px; box-shadow:0 3px 9px #eee;
}

.zoom-controls-fixed {
  position: fixed; top: 68px; right: 18px; z-index: 1050;
  background: transparent; border-radius: 18px;
  box-shadow: 0 2px 9px rgba(0,0,0,0.08);
  padding: 8px 16px 8px 12px; display: flex; align-items: center; gap: 8px; font-size: 15px;
}
.zoom-btn {
  width: 28px; height: 28px; line-height: 24px; text-align: center;
  font-size: 20px; font-weight: bold; border: none; background: #66FFFF;
  border-radius: 80%; cursor: pointer; margin: 0 2px; transition: background 0.18s; box-shadow: 0 1px 2px #ececec;
}
.zoom-btn:hover { background: #e7eaf1; }
.zoom-slider { width: 95px; margin: 0 2px; vertical-align: middle; }
.zoom-value { font-weight:600; margin-left:4px; min-width:40px; display:inline-block; text-align:right; }

.table { font-size: 1rem; border-radius: 9px; overflow: hidden; }
.table thead th { background: #f6f7f9; font-weight: 600; border-bottom: 2px solid #ececec !important; }
.table td, .table th { vertical-align: middle !important; padding: 10px 7px !important; }

.btn, .form-select, .form-control { border-radius: 7px !important; }

hr { border-top: 2px solid #e5e6eb; margin: 1rem 0; }
.sidebar-title { margin-bottom: 30px; }

#uploadBtn:disabled {
  background: #bbb !important; border-color: #bbb !important; color: #eee !important;
  opacity: 0.6 !important; cursor: not-allowed !important; box-shadow: none;
}

@media (max-width: 1023px) {
  .wrapper-main { flex-direction: column;}
  .sidebar {
    width: 100%; min-height: unset; border-radius: 0 0 14px 14px;
    box-shadow: none; margin-bottom: 12px; padding: 20px 10px 10px 10px;
  }
  .main { padding: 14px 5px;}
  .zoom-controls-fixed { right: 6px; top: 66px;}
}
@media (max-width: 600px) {
  .stat-card, .admin-section { padding: 13px 6px 7px 6px;}
  .sidebar { padding: 12px 2vw;}
  .main { padding: 7px 0;}
  .table td, .table th { font-size: 0.97em; padding: 8px 3px;}
  .stat-card .big-num { font-size: 1.39rem; }
}

/* ==========================================
   UPGRADE: Hiệu ứng QUAY (lóe sáng mạnh + lướt)
   ========================================== */

/* Nhấp nháy nền rất nhẹ toàn lưới khi chạy */
.mosaic-flash .avatar-img,
#mosaicGrid.mosaic-run .avatar-img {
  animation: mosaicTwinkle 1.1s ease-in-out infinite alternate;
  will-change: transform, filter;
}
@keyframes mosaicTwinkle {
  0%   { filter: brightness(1) contrast(1);   transform: scale(1); }
  100% { filter: brightness(1.22) contrast(1.08); transform: scale(1.05); }
}

/* Cell “bị quét” — tăng độ lóe & zoom rõ hơn */
.avatar-cell.glint > .avatar-img,
#mosaicGrid.mosaic-run .avatar-cell.shine > .avatar-img {
  transform: scale(1.28);
  filter: brightness(2.25) contrast(1.2) saturate(1.15)
          drop-shadow(0 0 10px rgba(255,255,255,.85));
  transition: transform 200ms ease, filter 200ms ease;
  will-change: transform, filter;
}
.avatar-cell.glint,
#mosaicGrid.mosaic-run .avatar-cell.shine {
  z-index: 98 !important;
  position: absolute;
  overflow: hidden;
  border-radius: 10px;
}

/* Vệt sáng lướt ngang, hẹp & sáng hơn để “lóe” rõ */
.avatar-cell.glint::after,
#mosaicGrid.mosaic-run .avatar-cell.shine::after {
  content: "";
  position: absolute;
  inset: -3px;
  pointer-events: none;
  border-radius: 12px;
  background:
    linear-gradient(120deg,
      rgba(255,255,255,0) 40%,
      rgba(255,255,255,1) 50%,
      rgba(255,255,255,0) 60%);
  mix-blend-mode: screen;
  filter: blur(.8px);
  transform: translateX(-140%) rotate(18deg);
  animation: glintSweep 480ms cubic-bezier(.17,.67,.3,1) forwards;
}
@keyframes glintSweep {
  100% { transform: translateX(140%) rotate(18deg); }
}

/* ==========================================
   UPGRADE: ẢNH THẮNG bay vào giữa rồi “POP-OUT”
   ========================================== */

/* Clone bay (đã có trong JS). Chỉ tinh chỉnh bóng/độ rực */
.flyout {
  position: fixed; pointer-events: none;
  transition: transform 820ms cubic-bezier(.2,.8,.2,1), opacity 820ms, filter 820ms;
  filter: drop-shadow(0 12px 28px rgba(0,0,0,.28)) saturate(1.05);
  border-radius: 12px;
  z-index: 1065;
  will-change: transform, opacity, filter;
}

/* Pha cuối: phóng to nhanh và mờ dần (JS thêm class .fly-pop trước khi remove) */
.flyout.fly-pop {
  /* Không đụng translate hiện có; chỉ “zoom & fade”.
     Dùng CSS Transform Level 2 (scale) — trình duyệt hiện đại đều hỗ trợ. */
  transition: scale 360ms cubic-bezier(.16,.84,.36,1), opacity 300ms ease-out, filter 300ms ease-out;
  scale: 2.8;             /* phóng nhanh */
  opacity: 0;             /* mờ dần */
  filter: drop-shadow(0 18px 36px rgba(0,0,0,.22)) saturate(1.15) brightness(1.05);
}

/* Fallback nếu browser chưa hỗ trợ property `scale` (ghi đè nhẹ) */
@supports not (scale: 1) {
  .flyout.fly-pop {
    transform: scale(2.8) !important; /* giữ nguyên translate do JS đã set, chỉ nhân scale tổng */
  }
}

/* ===============================
   Overlay quay: timer không che UI
   =============================== */
#drawOverlay {
  position: fixed; left: 50%; top: 12px; transform: translateX(-50%);
  z-index: 1060; display: none; pointer-events: none;
}
#drawOverlay .do-card {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(231,246,255,.92));
  border: 1px solid rgba(56,139,253,.16);
  box-shadow: 0 6px 24px rgba(56,139,253,.18);
  backdrop-filter: blur(6px);
}
#drawOverlay .do-title { font-weight: 700; }
#drawOverlay .do-sub { font-size: 12px; color:#666; }
#drawOverlay .do-timer { min-width: 60px; text-align: right; font-weight: 800; font-size: 20px; }
@media (max-width:600px){
  #drawOverlay .do-card { padding: 8px 10px; }
  #drawOverlay .do-timer { min-width: 54px; font-size: 18px; }
}

/* =========================================
   UPGRADE bổ sung: Overlay quay ở GIỮA MÀN HÌNH + TO ĐẸP
   (GIỮ CSS CŨ, chỉ override bên dưới – UI ONLY)
   ========================================= */

/* Đưa overlay ra giữa màn hình (không che click vì pointer-events:none) */
#drawOverlay{
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 2000 !important;
}

/* Card to hơn + nổi bật hơn */
#drawOverlay .do-card{
  gap: 18px !important;
  padding: 22px 28px !important;
  border-radius: 22px !important;

  /* nền sáng hơn + “sân khấu” hơn */
  background: radial-gradient(circle at 30% 10%,
              rgba(255,255,255,.98) 0%,
              rgba(230,245,255,.94) 55%,
              rgba(215,240,255,.92) 100%) !important;

  box-shadow:
    0 26px 80px rgba(56,139,253,.38),
    0 0 0 10px rgba(255,255,255,.35) !important;

  backdrop-filter: blur(10px) !important;

  /* hiệu ứng pop khi hiện */
  animation: drawOverlayPop .38s cubic-bezier(.16,.84,.36,1) both;
}

/* Icon to hơn */
#drawOverlay .do-icon{
  font-size: 2.4rem !important;
  filter: drop-shadow(0 0 10px rgba(56,139,253,.55));
}

/* Title/Sub to hơn */
#drawOverlay .do-title{
  font-weight: 900 !important;
  font-size: 1.35rem !important;
  letter-spacing: .02em;
}
#drawOverlay .do-sub{
  font-size: .95rem !important;
  opacity: .78;
}

/* TIMER: to + nổi + glow */
#drawOverlay .do-timer{
  min-width: 140px !important;
  text-align: center !important;
  font-weight: 900 !important;
  font-size: 3.4rem !important;
  letter-spacing: .08em;

  color: #0b5394 !important;
  text-shadow:
    0 0 10px rgba(56,139,253,.55),
    0 0 26px rgba(56,139,253,.28);
}

/* Pop animation */
@keyframes drawOverlayPop{
  0%   { transform: translate3d(0, 12px, 0) scale(.86); opacity: 0; }
  100% { transform: translate3d(0, 0, 0)  scale(1);    opacity: 1; }
}

/* Mobile: vẫn to nhưng gọn */
@media (max-width: 600px){
  #drawOverlay{
    top: 54% !important; /* hơi thấp để tránh notch */
  }
  #drawOverlay .do-card{
    padding: 16px 16px !important;
    gap: 12px !important;
  }
  #drawOverlay .do-timer{
    min-width: 110px !important;
    font-size: 2.6rem !important;
  }
}

/* =========================================
   Overlay timer: urgent color + shake/pulse
   ========================================= */

#drawOverlay .do-card.tick {
  animation: doTickShake 120ms ease-in-out;
}

@keyframes doTickShake{
  0%   { transform: translate3d(0,0,0) scale(1); }
  35%  { transform: translate3d(-1px,0,0) scale(1.01); }
  70%  { transform: translate3d( 1px,0,0) scale(1.01); }
  100% { transform: translate3d(0,0,0) scale(1); }
}

/* Khi còn < 5s */
#drawOverlay .do-timer.is-urgent{
  color:#d33439 !important;
  text-shadow:
    0 0 10px rgba(211,52,57,.55),
    0 0 26px rgba(255,255,255,.25) !important;
  animation: urgentPulse 600ms ease-in-out infinite;
}

@keyframes urgentPulse{
  0%,100%{ transform: scale(1); filter: brightness(1); }
  50%    { transform: scale(1.06); filter: brightness(1.15); }
}

/* ======================================================
   Modal kết quả (xanh lam sáng, hiện đại) — giữ như bản trước
   ====================================================== */
.modal-backdrop.show,
.modal-backdrop.fade.show {
  background: radial-gradient(
    60% 60% at 50% 40%,
    rgba(56,139,253,.14) 0%,
    rgba(56,139,253,.22) 40%,
    rgba(12,74,179,.30) 100%
  ) !important;
  backdrop-filter: blur(2px);
}
#drawModal .modal-dialog { max-width: 1100px; }
#drawModal .modal-content {
  border: 1px solid transparent; border-radius: 18px; overflow: hidden;
  background: linear-gradient(180deg, rgba(241,248,255,.96) 0%, rgba(224,241,255,.94) 100%) padding-box,
              linear-gradient(135deg, rgba(71,147,255,.28), rgba(71,147,255,0)) border-box;
  color: #0e2a47; backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(56,139,253,.25);
}
#drawModal .modal-header { background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%); color: #fff; border: 0; }
#drawModal .modal-title { font-weight: 800; letter-spacing: .2px; }
#drawModal .btn-close { filter: invert(1) grayscale(1) brightness(200%); opacity: .9; }

#drawStepResult .prize-head,
#drawStepResult .d-flex.align-items-center.gap-2 { align-items: center; gap: 12px !important; }
#prizeImgPreview {
  height: 54px !important; width: auto;
  border-radius: 12px; background: #fff; padding: 2px 6px;
  box-shadow: 0 6px 18px rgba(56,139,253,.25);
}
#prizeName {
  font-size: 1.35rem; font-weight: 900; margin-bottom: 2px;
  background: linear-gradient(90deg, #0b5394, #3b82f6, #0b5394);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
#prizeValue {
  font-size: .95rem; color: #0b1a34; font-weight: 700;
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  background: linear-gradient(135deg, #dff3ff, #bfe6ff 60%, #a6dcff);
  box-shadow: 0 6px 16px rgba(56,139,253,.22);
}

#winnersGrid { margin-top: 8px; }
#winnersGrid .card {
  border: 1px solid rgba(56,139,253,.12); border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f5faff 100%);
  color: #0e2a47; box-shadow: 0 12px 30px rgba(56,139,253,.16);
  backdrop-filter: blur(4px);
  transform: translateY(0);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
#winnersGrid .card:hover { transform: translateY(-4px); box-shadow: 0 18px 38px rgba(56,139,253,.22); background: #ffffff; }
#winnersGrid .card-img-top { height: 160px; object-fit: cover; border-top-left-radius: 14px; border-top-right-radius: 14px; }
#winnersGrid .card .fw-bold.small { font-weight: 800 !important; letter-spacing: .1px; color: #0e2a47; }
#winnersGrid .card .text-muted.small { color: #5b6b88 !important; opacity: 1; }

/* Sparkle nhẹ khi hiển thị kết quả */
#drawModal.show #drawStepResult:not(.d-none)::before {
  content:""; position:absolute; inset:0; pointer-events:none;
  background:
    radial-gradient(6px 6px at 20% 25%, rgba(255,255,255,.55), rgba(255,255,255,0) 60%),
    radial-gradient(5px 5px at 75% 30%, rgba(255,255,255,.50), rgba(255,255,255,0) 60%),
    radial-gradient(4px 4px at 40% 80%, rgba(255,255,255,.45), rgba(255,255,255,0) 60%),
    radial-gradient(5px 5px at 90% 70%, rgba(255,255,255,.40), rgba(255,255,255,0) 60%);
  animation: sparkFloat 2.2s ease-in-out infinite alternate;
}
@keyframes sparkFloat {
  0% { transform: translateY(0); opacity:.8; }
  100% { transform: translateY(-6px); opacity:1; }
}

#drawModal .modal-footer {
  border: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(219,234,254,.5));
}
#drawModal .btn-primary,
#drawModal .btn-outline-secondary,
#drawModal .btn-light { border-radius: 10px; }

/* QR modal – modern look */
.qr-hero {
  background: linear-gradient(135deg,#f3f8ff 0%, #ffffff 60%);
  border-bottom: 1px solid #edf2f7;
  padding: 10px 16px;
}
.qr-title {
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:700;
  letter-spacing:.2px;
}
.qr-title .qr-badge {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border-radius:10px;
  background:#eaf3ff;
  color:#0b5ed7;
  font-size:18px;
}

/* Card chứa QR */
.qr-card {
  background:#fff;
  border:1px solid #e9eef5;
  border-radius:20px;
  padding:16px;
  box-shadow:0 10px 26px rgba(16,24,40,.06);
  display:inline-block;
}

/* Kích thước QR: áp dụng cho cả upload & draw */
#qrBox canvas,
#qrBox img,
#qrDrawBox canvas,
#qrDrawBox img {
  display:block;
  max-width:260px;    /* thu nhỏ QR */
  width:100%;
  height:auto;
  border-radius:12px;
  margin:0 auto;      /* căn giữa trong .qr-card */
}

.qr-caption{
  color:#64748b;
  font-size:.9rem;
  margin-top:10px;
}

.qr-url {
  display:flex;
  align-items:center;
  gap:8px;
  background:#f8fafc;
  border:1px dashed #e2e8f0;
  border-radius:12px;
  padding:10px 12px;
  line-height:1.2;
}
.qr-url code#qrUrlTxt,
.qr-url code#qrDrawUrlTxt {
  color:#0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
               "Liberation Mono","Courier New", monospace;
  font-size:.92rem;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  display:block;
  width:100%;
}

.qr-actions .btn{
  border-radius:12px;
  padding:10px 14px;
}

.qr-note {
  color:#6b7280;
  font-size:.9rem;
}


/* ==== Sidebar collapse ==== */
:root{ --sidebar-w: 360px; }
.sidebar{
  flex: 0 0 var(--sidebar-w);
  max-width: var(--sidebar-w);
  width: var(--sidebar-w);
  transition: flex-basis .28s ease, max-width .28s ease;
}
.sidebar-inner{
  transition: opacity .18s ease;
}
.main{ flex: 1 1 auto; min-width: 0; }

/* Trạng thái thu gọn */
body.is-sidebar-collapsed{ --sidebar-w: 0px; }
body.is-sidebar-collapsed .sidebar-inner{
  opacity: 0; pointer-events: none;
}

/* Nút nổi ẩn/hiện sidebar */
.sidebar-toggle{
  position: fixed;
  left: 12px; top: 92px;
  z-index: 1001;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius: 999px;
  padding: 8px 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.sidebar-toggle i{ font-size: 1.05rem; }
.sidebar-toggle .label{ font-weight:600; font-size:.92rem; }

@media (max-width: 1200px){
  :root{ --sidebar-w: 320px; }
}

        .find-photo-box input, .find-photo-box select { font-size:1.03em; }
        .found-highlight { animation: photoZoomFlash 1.8s cubic-bezier(.64,.04,.27,.99); z-index:99 !important;}
        @keyframes photoZoomFlash {
            0%   { box-shadow: 0 0 0 0 #d33439, 0 0 12px #fff; transform:scale(1);}
            20%  { box-shadow: 0 0 0 20px #ffd50066, 0 0 36px #fff; transform:scale(2.2);}
            45%  { box-shadow: 0 0 0 16px #ffd50033, 0 0 18px #fff; transform:scale(1.7);}
            75%  { box-shadow: 0 0 0 7px #d3343955, 0 0 9px #fff; transform:scale(1.3);}
            100% { box-shadow: 0 0 0 0 #fff0, 0 0 3px #fff; transform:scale(1);}
        }

.navbar-nav .nav-link {
    font-weight: 700; /* chữ đậm */
    position: relative;
    transition: color .2s ease, text-shadow .2s ease;
}

/* ⭐ Hiệu ứng viền sáng khi hover */
.navbar-nav .nav-link:hover {
    color: #ff0000; /* làm sáng chữ */
    text-shadow:
        0 0 4px rgba(255,255,255,0.8),
        0 0 8px rgba(255,255,255,0.7),
        0 0 12px rgba(255,255,255,0.6);
}

.qr-btn {
    color: #fff700 !important;
    border-color: #fff !important;   /* viền trắng cho đồng bộ */
}

/* Nếu muốn hover sáng hơn */
.qr-btn:hover {
    background-color: rgba(255,255,255,0.2) !important;
    color: #f2ff00 !important;
}

.qr-btn:hover {
    text-shadow: 0 0 6px rgba(255,255,255,0.8);
    box-shadow: 0 0 8px rgba(255,255,255,0.7);
}

.glow-text {
    font-weight: 900;
    text-shadow:
        0 0 4px rgba(255,255,255,0.8),
        0 0 8px currentColor,
        0 0 14px currentColor;
}


/* Tuyết rơi trong khu vực main */
/* Đảm bảo vùng main là vùng chứa tuyết */
/* ============================================
   SNOWFLAKE ENHANCED – Lấp lánh + Glow + Xoay
   ============================================ */

.main {
    position: relative;
    overflow: hidden;
}

/* Lớp phủ tuyết */
#snow-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

/* Một bông tuyết */
.snowflake {
    position: absolute;
    top: -10%;
    opacity: 0.45;
    will-change: transform, opacity;
    animation-name: snowFall, snowSparkle, snowRotate;
    animation-timing-function: linear, ease-in-out, linear;
    animation-iteration-count: infinite, infinite, infinite;

    /* Hiệu ứng glow nhẹ */
    filter: drop-shadow(0 0 6px rgba(255,255,255,0.7))
            drop-shadow(0 0 12px rgba(255,255,255,0.4));
}

/* Rơi xuống + lắc nhẹ */
@keyframes snowFall {
    0% {
        top: -10%;
        transform: translateX(0);
    }
    50% {
        transform: translateX(18px);
    }
    100% {
        top: 100%;
        transform: translateX(-18px);
    }
}

/* ✨ Hiệu ứng lấp lánh – opacity thay đổi nhẹ */
@keyframes snowSparkle {
    0%, 90% { opacity: 0.45; }
    25%     { opacity: 0.85; }
    50%     { opacity: 0.65; }
    75%     { opacity: 0.9; }
}

/* ❄️ Xoay nhẹ theo hướng gió */
@keyframes snowRotate {
    0%   { transform: rotate(0deg); }
    50%  { transform: rotate(12deg); }
    100% { transform: rotate(-8deg); }
}

/* Ông già Noel + xe tuần lộc */
/* ==== SANTA & REINDEER FLY ==== */
#santa {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    z-index: 8;
    width: clamp(140px, 18vw, 260px);
    filter: drop-shadow(0 0 12px rgba(255,255,255,0.85)) blur(0.4px);
    transform-origin: center center;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
}

/* Route 1: bay ngang trên cây thông, từ trái sang phải */
#santa.santa-route-1 {
    top: 18%;
    left: -30%;
    animation: santaFly1 20s linear forwards;
}

/* Route 2: từ dưới góc phải (gần footer) bay chéo lên góc trái trên */
#santa.santa-route-2 {
    bottom: -8%;
    right: -65%;
    top: auto;
    left: auto;
    animation: santaFly2 30s linear forwards;
}

/* Bay ngang + nhấp nhô + hơi lắc */
@keyframes santaFly1 {
    0% {
        transform: translate3d(0, 0, 0) scale(0.95) rotate(-3deg);
        opacity: 0;
    }
    5%  { opacity: 0.95; }
    25% { transform: translate3d(35vw, -10px, 0) scale(1)    rotate(2deg); }
    50% { transform: translate3d(70vw, -18px, 0) scale(1.03) rotate(-2deg); }
    75% { transform: translate3d(105vw,-12px, 0) scale(1.02) rotate(3deg); }
    100%{
        transform: translate3d(130vw,-6px, 0)  scale(1)    rotate(0deg);
        opacity: 0;
    }
}

/* Bay chéo từ dưới phải lên trên trái, nhấp nhô + đưa lên sát header */
@keyframes santaFly2 {
    0% {
        transform: translate3d(0, 0, 0) scale(0.9) rotate(5deg);
        opacity: 0;
    }

    10% {
        opacity: 0.95;
    }

    /* Bay cao hơn (tới ~60% màn hình) */
    40% {
        transform: translate3d(-60vw, -55vh, 0) scale(1) rotate(-2deg);
    }

    /* Gần sát mép dưới của header */
    70% {
        transform: translate3d(-90vw, -95vh, 0) scale(1.05) rotate(3deg);
    }

    /* Bay qua khỏi góc trái trên – sát header */
    100% {
        transform: translate3d(-120vw, -115vh, 0) scale(1.07) rotate(-4deg);
        opacity: 0;
    }
}

/* ===============================
   HEADER TOGGLE (INSIDE NAVBAR)
   =============================== */

.custom-navbar {
  position: relative;
  transition: transform .35s ease, opacity .25s ease;
}

/* Khi ẩn header */
body.header-hidden .custom-navbar {
  transform: translateY(-110%);
  opacity: 0;
}

/* Nút mũi tên trong header */
.header-toggle {
  position: absolute;
  right: 6px;
  top: 2%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background .2s ease, transform .25s ease;
}

.header-toggle:hover {
  background: rgba(255,255,255,0.95);
  transform: translateY(-50%) scale(1.12);
}

.header-toggle i {
  font-size: 14px;
  transition: transform .35s ease;
}

/* Header đang ẩn → mũi tên quay xuống */
body.header-hidden .header-toggle i {
  transform: rotate(180deg);
}

/* ===== Sidebar Avatar ===== */
.sidebar-avatar{
  line-height:1;
  text-align:center;
}

.sidebar-avatar img{
  height:48px;              /* 👈 chỉnh tuỳ ý */
  width:auto;
  object-fit:contain;
}

.sidebar-avatar .fallback-icon{
  display:none;             /* chỉ hiện khi ảnh lỗi */
  font-size:2.3rem;
  color:#d33439;
}

/* ==== Draw Gate ==== */
.draw-gate-wrap{
  position: relative;
}

.draw-panel.is-locked{
  filter: blur(1.2px) grayscale(0.2);
  opacity: .55;
  pointer-events: none;
  user-select: none;
}

.draw-gate-overlay{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(2px);
  border-radius: 10px;
}

.draw-gate-card{
  width: 100%;
  max-width: 260px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,.10);
}

/* ===== Brand wrap (logo + tên) ===== */
.custom-navbar .brand-wrap{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 350px;
  padding: 2px 14px;
  border-radius: 999px;

  background: rgba(255,255,255,.22);
  border: 0px solid rgba(255,255,255,.60);
  backdrop-filter: blur(1px);

  box-shadow: 0 10px 26px rgba(0,0,0,.14);
}

/* Logo */
.custom-navbar .brand-wrap img{
  filter:
    drop-shadow(0 2px 10px rgba(0,0,0,.32))
    drop-shadow(0 0 2px rgba(255,255,255,.95));
}

/* Text */
.custom-navbar .brand-wrap .navbar-brand{
  padding: 0 !important;
  margin: 0 !important;

  font-weight: 900;
  letter-spacing: .3px;

  color: #ffffff !important;
  -webkit-text-stroke: 1px rgba(0,0,0,.18);
  text-shadow:
    0 2px 10px rgba(0,0,0,.55),
    0 0 2px rgba(145, 154, 255, 0.95);
}

/* =====================================
   HOME TITLE – nâng cấp viền + shadow
   ===================================== */

/* Khối tiêu đề chính */
.section-title-christmas{
  position: relative;
  z-index: 20;                 /* luôn nổi trên tuyết / santa */
  margin-bottom: 14px;
}

/* Dòng 1: TIÊU ĐỀ CHÍNH */
.section-title-christmas b{
  display: inline-block;

  /* Giữ màu gốc (vàng) từ inline style / setting */
  color: inherit;

  font-weight: 900;
  letter-spacing: .06em;

  /* Viền trắng rất nhẹ */
  -webkit-text-stroke: 1px rgba(255,255,255,.65);

  /* Shadow nổi + glow */
  text-shadow:
    0 2px 6px rgba(0,0,0,.35),
    0 0 12px rgba(255,215,120,.45),
    0 0 2px rgba(255,255,255,.9);
}

/* Emoji đứng đầu cũng nổi hơn */
.section-title-christmas b span:first-child{
  filter: drop-shadow(0 0 6px rgba(255,255,255,.8));
}

/* Dòng 2 (sub-title) */
.section-title-christmas .glow-text{
  display: inline-block;
  margin-left: 6px;

  font-weight: 900;
  letter-spacing: .04em;

  /* Viền trắng mảnh hơn dòng 1 */
 -webkit-text-stroke: 1.2px rgba(255,255,255,.75);


  /* Shadow đỏ ấm + glow */
  text-shadow:
    0 2px 8px rgba(0,0,0,.35),
    0 0 14px rgba(255,80,80,.55),
    0 0 3px rgba(255,255,255,.85);
}

@font-face{
  font-family: "VNCalligraphyTitle";
  src: url("../fonts/woff2/UTM-ThuPhap-Thien-An-dzwj7m.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face{
  font-family: "VNCalligraphySub";
  src: url("../fonts/woff2/UTM-ThuPhap-Thien-An-dzwj7m.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* ===============================
   HOME TITLE – VN CALLIGRAPHY
   =============================== */
.section-title-christmas{
  position: relative;
  z-index: 20;
  margin-bottom: 14px;
}

/* Dòng 1 (tiêu đề chính) */
.section-title-christmas b{
  font-family: "VNCalligraphyTitle", "Times New Roman", serif !important;
  font-weight: 300 !important;
  letter-spacing: .03em;
  line-height: 1.0;

  /* viền trắng nhẹ */
  -webkit-text-stroke: 1px rgba(255,255,255,.68);

  /* shadow nổi + glow */
  text-shadow:
    0 3px 10px rgba(0,0,0,.38),
    0 0 18px rgba(255,220,140,.40),
    0 0 3px rgba(255,255,255,.9);
}

/* Dòng 2 (phụ) */
.section-title-christmas .glow-text{
  font-family: "VNCalligraphySub", "Times New Roman", serif !important;
  font-weight: 300 !important;
  letter-spacing: .02em;

  -webkit-text-stroke: .85px rgba(255,255,255,.58);

  text-shadow:
    0 2px 8px rgba(0,0,0,.35),
    0 0 16px rgba(255,90,90,.50),
    0 0 2px rgba(255,255,255,.85);
}
