:root {
    --primary: #ff99ac;
    --secondary: #ff477e;
    --text: #643a4a;
    --bg: #fff0f5;
    --glass: rgba(255, 255, 255, 0.95);
    --shadow: 0 8px 30px rgba(255, 71, 126, 0.25);
    --gold: #ffd700;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    font-family: 'Nunito', sans-serif;
    background: #fff0f5;
    color: var(--text);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
}


/* CANVAS NỀN */

#sakura-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}


/* --- 1. MÀN HÌNH KHÓA --- */

#lock-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg, rgba(255, 195, 160, 0.95) 0%, rgba(255, 175, 189, 0.95) 100%);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: 0.8s cubic-bezier(0.77, 0, 0.175, 1);
    padding-bottom: 20px;
}

.lock-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 320px;
    padding: 15px;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lock-widget {
    text-align: center;
    margin-bottom: 20px;
    color: white;
    text-shadow: 0 2px 10px rgba(255, 71, 126, 0.3);
}

.lock-time {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
}

.lock-date {
    font-size: 1rem;
    margin-top: 5px;
    font-weight: 600;
    letter-spacing: 1px;
}


/* Trái tim phát sáng */

.heart-wrapper-glow {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.luxury-heart-glow {
    width: 80px;
    height: 80px;
    fill: url(#heart-gradient-glow);
    filter: drop-shadow(0 0 15px rgba(255, 247, 163, 0.8));
    animation: heartBeatGlow 2s infinite ease-in-out;
}

@keyframes heartBeatGlow {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}


/* Chấm tròn mật khẩu */

.pass-display {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.pass-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid white;
    transition: 0.3s;
}

.pass-dot.active {
    background: white;
    box-shadow: 0 0 12px white;
}


/* Bàn phím số */

.numpad {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 260px;
    margin: 0 auto;
}

.num-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.num-btn {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    color: white;
    font-size: 1.6rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.num-btn:active {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0.95);
}

.num-dummy {
    visibility: hidden;
    pointer-events: none;
}

.num-del {
    font-size: 1.3rem;
}


/* --- 2. GIAO DIỆN CHÍNH (MOBILE) --- */

#app {
    display: none;
    width: 100%;
    height: 100%;
    background: #fff0f5;
    overflow-y: auto;
    position: relative;
    z-index: 1;
    padding: 15px 15px 100px 15px;
    margin: 0 auto;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    color: var(--secondary);
    margin-bottom: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.greeting {
    font-family: 'Pacifico', cursive;
    font-size: 1.6rem;
    color: var(--secondary);
    margin-bottom: 15px;
    min-height: 40px;
    text-align: center;
}


/* Slider Mobile */

.photo-slider {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 5px;
    scroll-snap-type: x mandatory;
    margin-bottom: 20px;
}

.slide-item {
    min-width: 85%;
    height: 200px;
    border-radius: 22px;
    scroll-snap-align: center;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 3px solid white;
    position: relative;
}

.slide-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-caption {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    padding: 8px 15px;
    color: var(--secondary);
    font-weight: bold;
    font-size: 0.85rem;
}


/* Card Chung */

.card {
    background: var(--glass);
    border-radius: 22px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
    border: 1px solid white;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.counter-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    text-align: center;
}

.big-days {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--secondary);
    line-height: 1;
}

.fab-add {
    width: 32px;
    height: 32px;
    background: var(--secondary);
    color: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}


/* THẺ VIP */

.vip-card-container {
    perspective: 1000px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.vip-card {
    width: 100%;
    max-width: 380px;
    height: 220px;
    background: linear-gradient(135deg, #ff99ac 0%, #ff477e 100%);
    border-radius: 20px;
    padding: 20px;
    color: white;
    position: relative;
    box-shadow: 0 10px 30px rgba(255, 71, 126, 0.4);
    font-family: 'Courier New', monospace;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.vip-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(30deg);
    animation: shimmer 4s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) rotate(30deg);
    }
    100% {
        transform: translateX(100%) rotate(30deg);
    }
}

.card-header {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-family: sans-serif;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.card-rank {
    color: var(--gold);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.card-chip {
    width: 50px;
    height: 38px;
    background: linear-gradient(135deg, #e6c888, #c69f54);
    border-radius: 6px;
    position: relative;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
    margin: 5px 0;
}

.chip-line {
    width: 100%;
    height: 1px;
    background: rgba(0, 0, 0, 0.2);
    position: absolute;
}

.chip-line:nth-child(1) {
    top: 33%;
}

.chip-line:nth-child(2) {
    top: 66%;
}

.chip-line:nth-child(3) {
    left: 33%;
    height: 100%;
    width: 1px;
    top: 0;
}

.chip-line:nth-child(4) {
    left: 66%;
    height: 100%;
    width: 1px;
    top: 0;
}

.card-number {
    font-size: 1.3rem;
    letter-spacing: 2px;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
    font-weight: bold;
    text-align: center;
    margin: 10px 0;
}

.card-info {
    display: flex;
    justify-content: flex-start;
    gap: 30px;
    font-family: sans-serif;
    text-transform: uppercase;
    font-size: 0.7rem;
    position: relative;
    z-index: 2;
}

.card-info .label {
    opacity: 0.8;
    font-size: 0.6rem;
    margin-bottom: 2px;
    display: block;
}

.card-info .name,
.card-info .date {
    font-weight: bold;
    font-size: 0.95rem;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.card-title {
    position: absolute;
    bottom: 18px;
    right: 20px;
    font-size: 0.75rem;
    opacity: 0.9;
    font-family: sans-serif;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 4px;
}

.benefit-list {
    list-style: none;
    text-align: left;
    font-size: 0.95rem;
    color: #555;
}

.benefit-list li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
}

.benefit-list li::before {
    content: '•';
    color: var(--secondary);
    position: absolute;
    left: 0;
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1rem;
}

.timeline-mini {
    margin-top: 15px;
    max-height: 350px;
    overflow-y: auto;
}

.tl-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.tl-time {
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--secondary);
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-align: center;
}

.tl-card {
    background: white;
    padding: 10px 12px;
    border-radius: 12px 12px 12px 0;
    flex: 1;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    position: relative;
    color: #555;
}

.btn-del {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.8rem;
    color: #ffb7b2;
    cursor: pointer;
}

.calendar-container {
    padding: 5px;
}

.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.calendar-controls h4 {
    font-size: 1.1rem;
    color: var(--secondary);
    font-weight: 800;
    text-transform: capitalize;
}

.calendar-controls button {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text);
    padding: 5px 10px;
    cursor: pointer;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    font-size: 0.75rem;
    color: #aaa;
    margin-bottom: 8px;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    font-size: 0.85rem;
    position: relative;
    cursor: pointer;
    transition: 0.2s;
}

.cal-day.today {
    border: 2px solid var(--secondary);
    color: var(--secondary);
    font-weight: bold;
    background: white;
}

.cal-day.has-note {
    background: var(--secondary);
    color: white;
    box-shadow: 0 3px 8px rgba(255, 71, 126, 0.4);
}

.btn-discord-pink {
    width: 100%;
    border: none;
    background: white;
    color: var(--secondary);
    font-weight: 800;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: 0.3s;
    border-radius: 18px;
}

.btn-discord-pink:active {
    transform: scale(0.98);
    background: #fff0f5;
}

.dock {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 0 35px;
    height: 65px;
    border-radius: 35px;
    display: flex;
    align-items: center;
    gap: 50px;
    box-shadow: 0 10px 30px rgba(255, 92, 138, 0.25);
    z-index: 100;
}

.dock-icon {
    font-size: 1.4rem;
    color: #d1d1d1;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: 0.4s;
    cursor: pointer;
}

.dock-icon.active {
    background: var(--secondary);
    color: white;
    transform: translateY(-20px) scale(1.2);
    box-shadow: 0 8px 15px rgba(255, 71, 126, 0.4);
    border: 3px solid #fff0f5;
}

#custom-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
    padding: 20px;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 300px;
    padding: 22px;
    border-radius: 28px;
    text-align: center;
    animation: popIn 0.3s;
}

.modal-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ffe6eb;
    border-radius: 15px;
    margin: 15px 0;
    outline: none;
    background: #fffbfc;
}

.modal-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn {
    padding: 10px 25px;
    border-radius: 20px;
    border: none;
    font-weight: bold;
    cursor: pointer;
}

.btn-confirm {
    background: var(--secondary);
    color: white;
}

.btn-cancel {
    background: #f0f0f0;
    color: #666;
}


/* ========================================================================= */


/* 💻 GIAO DIỆN MÁY TÍNH (PC MODE) - TINH TẾ & CÂN ĐỐI */


/* ========================================================================= */

@media (min-width: 1024px) {
    body {
        overflow-y: auto;
        background-image: url('https://www.transparenttextures.com/patterns/cubes.png');
        background-color: #ffe6eb;
    }
    #lock-screen {
        z-index: 99999;
    }
    /* LAYOUT DASHBOARD: Căn giữa, không full màn hình quá mức */
    #app {
        display: none;
        /* JS sẽ bật */
        max-width: 1000px;
        /* Độ rộng vừa phải, sang trọng */
        width: 100%;
        height: auto;
        min-height: 100vh;
        margin: 0 auto;
        padding: 40px 40px 40px 120px;
        /* Padding trái để né Sidebar */
        background: transparent;
        overflow: visible;
    }
    /* TIÊU ĐỀ: Căn giữa trang */
    .greeting {
        font-size: 2.8rem;
        margin-bottom: 40px;
        text-align: center;
        /* Đã sửa thành căn giữa */
        text-shadow: 2px 2px 0px white;
        width: 100%;
        padding-left: 0;
    }
    .status-bar {
        display: none;
    }
    /* SIDEBAR DỌC: Nhỏ gọn hơn */
    .dock {
        width: 80px;
        height: auto;
        flex-direction: column;
        top: 100px;
        left: calc(50% - 580px);
        /* Căn chỉnh theo độ rộng 1000px */
        bottom: auto;
        transform: none;
        padding: 30px 0;
        gap: 40px;
        border-radius: 40px;
        background: white;
        box-shadow: 5px 10px 20px rgba(255, 71, 126, 0.1);
        position: fixed;
    }
    /* === HOME TAB: 2 Cột cân đối === */
    #tab-home {
        display: grid;
        grid-template-columns: 2fr 1.2fr;
        grid-template-rows: auto auto;
        gap: 25px;
    }
    /* Counter: Font size vừa phải */
    .counter-box {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
        height: 100%;
        background: white;
    }
    .big-days {
        font-size: 3.5rem;
    }
    /* Giảm kích thước */
    /* Slider ảnh: Dạng lưới 3 cột nhỏ xinh */
    .photo-slider {
        grid-column: 1 / 2;
        grid-row: 1 / 3;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        /* 3 ảnh 1 hàng */
        gap: 15px;
        height: auto;
        overflow: visible;
        padding: 0;
    }
    .slide-item {
        min-width: auto;
        width: 100%;
        height: 180px;
        /* Chiều cao ảnh vừa phải */
        border-radius: 15px;
    }
    .card:has(.timeline-mini) {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
        height: 100%;
    }
    .timeline-mini {
        max-height: 400px;
    }
    /* === VIP TAB === */
    #tab-vip {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 30px;
        align-items: start;
    }
    /* Thẻ VIP: Kích thước chuẩn */
    .vip-card-container {
        margin-bottom: 0;
    }
    .vip-card {
        width: 100%;
        max-width: 100%;
        height: 210px;
    }
    .card-number {
        font-size: 1.3rem;
        margin: 15px 0;
    }
    .btn-discord-pink {
        margin-top: 15px;
        padding: 15px;
    }
    /* Lịch: Gọn gàng */
    .calendar-container {
        height: 100%;
        min-height: 450px;
        background: white;
    }
    .cal-day {
        font-size: 1rem;
        border-radius: 10px;
    }
}