/* ============================================================
   KF-FIX: cac ban va bo sung cho ban thiệp tĩnh (GitHub/Vercel)
   1) Lịch cưới: chieu cao gon nhu ban goc
   2) Nut nhac trai tim co dinh goc duoi trai
   3) Chong keo tha anh
   ============================================================ */

/* ---- 1) Lịch cưới gọn lại ---- */
.edit_Calendar .calendar-wrapper {
    height: auto !important;
}
.edit_Calendar .calendar-header {
    height: auto !important;
}
.edit_Calendar .calendar-header div {
    padding: 8px 0;
}
.edit_Calendar .calendar-body {
    flex: none !important;
    grid-template-rows: repeat(5, 44px) !important;
    grid-auto-rows: 44px !important;
    gap: 6px !important;
    padding: 8px 10px 12px !important;
}
.edit_Calendar .calendar-day {
    height: auto !important;
}
@media (max-width: 768px) {
    .edit_Calendar .calendar-body {
        grid-template-rows: repeat(5, 40px) !important;
        grid-auto-rows: 40px !important;
    }
}

/* ---- 2) Nút nhạc trái tim — góc dưới trái, hiện sau khi mở thiệp ---- */
#kf-music-btn {
    position: fixed;
    left: 16px;
    bottom: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(232, 236, 255, .35);
    background: radial-gradient(circle at 35% 30%, #5B6FD0, #2A3A86 55%, #121A3A);
    box-shadow: 0 0 0 4px rgba(7, 11, 28, .45), 0 0 22px rgba(150, 172, 255, .55), 0 6px 18px rgba(0, 0, 0, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999990;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity .8s ease, transform .15s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
body:not(.sr-khoa) #kf-music-btn {
    opacity: 1;
    pointer-events: auto;
}
#kf-music-btn:active { transform: scale(.9); }
#kf-music-btn svg {
    width: 22px;
    height: 22px;
    fill: #fff;
    display: block;
}
#kf-music-btn.playing svg { animation: kf-xoay 5s linear infinite; }
#kf-music-btn.playing::before {
    content: "";
    position: absolute;
    inset: -9px;
    border-radius: 50%;
    pointer-events: none;
    border: 2px solid rgba(180, 198, 255, .55);
    animation: kf-gon 1.8s ease-out infinite;
}
#kf-music-btn.khong-nhac {
    filter: grayscale(.8);
    opacity: .45 !important;
}
@keyframes kf-xoay { to { transform: rotate(360deg); } }
@keyframes kf-gon {
    0% { transform: scale(.8); opacity: 1; }
    100% { transform: scale(1.25); opacity: 0; }
}

/* ---- 3) Không kéo thả ảnh ra ngoài ---- */
img {
    -webkit-user-drag: none;
    user-drag: none;
}

/* ---- 4) Thank You: hiệu ứng óng ánh ôm theo khung chữ nhật bo góc ---- */
/* Khung ảnh Thank You bo góc 42px, nhưng vòng hào quang / vệt sáng / vòng
   quỹ đạo gốc được vẽ theo hình tròn (border-radius: 50%) nên phình ra ở
   giữa cạnh và hụt ở 4 góc. Các rule dưới đưa tất cả về cùng bán kính với
   khung (42px + khoảng lùi), sao lấp lánh bám theo chu vi khung. */
.sr-ket .sr-quy-dao.bau-duc::before {
    inset: -14px;
    border-radius: 56px;
}
.sr-ket .sr-quy-dao.bau-duc .hao-quang {
    border-radius: 49px;
}
.sr-ket .sr-quy-dao.bau-duc .vet-sang {
    border-radius: 42px;
}
.sr-ket .sr-quy-dao.bau-duc .l1 { left: -5%; top: 8%; }
.sr-ket .sr-quy-dao.bau-duc .l2 { right: -5%; top: 26%; }
.sr-ket .sr-quy-dao.bau-duc .l3 { right: 8%; bottom: -3.5%; }
.sr-ket .sr-quy-dao.bau-duc .l4 { left: 7%; bottom: 10%; }
.sr-ket .sr-quy-dao.bau-duc .l5 { left: 50%; top: -4.5%; }

/* ============================================================
   KF-AUTO — Nút điều khiển cuộn tự động
   (đi kèm assets/js/kf-auto.js; hiệu ứng hiện nội dung do
   chính hệ thống .sr-hien của mẫu đảm nhận, không phủ thêm)
   ============================================================ */
#kf-auto-btn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 99999;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(220, 183, 50, .65);
    background: rgba(11, 17, 48, .82);
    color: #E8C766;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
    opacity: .88;
    padding: 0;
}
#kf-auto-btn:active {
    transform: scale(.93);
}
