:root {
    --primary: #a8e6cf;
    --secondary: #3eb489;
    --text: #2d6a4f;
    --bg: #f0fdf4;
    --glass: rgba(255, 255, 255, 0.9);
    --shadow: 0 8px 30px rgba(62, 180, 137, 0.2);
    --gold: #ffd700;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: manipulation;
}

body {
    font-family: 'Nunito', sans-serif;
    background: #f0fdf4;
    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(168, 230, 207, 0.95) 0%, rgba(240, 253, 244, 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: var(--text);
    text-shadow: 0 2px 10px rgba(62, 180, 137, 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;
}

.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);
    }
}

.pass-display {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.pass-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--secondary);
    transition: 0.3s;
}

.pass-dot.active {
    background: var(--secondary);
    box-shadow: 0 0 12px var(--secondary);
}

.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.5);
    backdrop-filter: blur(5px);
    color: var(--text);
    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.8);
    transform: scale(0.95);
}

.num-dummy {
    visibility: hidden;
    pointer-events: none;
}

.num-del {
    font-size: 1.3rem;
}


/* --- 2. GIAO DIỆN CHÍNH --- */

#app {
    display: none;
    width: 100%;
    height: 100%;
    background: #f0fdf4;
    overflow-y: auto;
    position: relative;
    z-index: 1;
    padding: 15px 15px 120px 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;
}

.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 {
    background: var(--glass);
    border-radius: 22px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
    border: 1px solid white;
    animation: slideUp 0.5s ease;
    backdrop-filter: blur(5px);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.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;
}


/* VIP CARD */

.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, #a8e6cf 0%, #3eb489 100%);
    border-radius: 20px;
    padding: 20px;
    color: white;
    position: relative;
    box-shadow: 0 10px 30px rgba(62, 180, 137, 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: #a8e6cf;
    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(62, 180, 137, 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: #f0fdf4;
}


/* DOCK MENU */

.dock {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 0 25px;
    height: 65px;
    border-radius: 35px;
    display: flex;
    align-items: center;
    gap: 30px;
    box-shadow: 0 10px 30px rgba(62, 180, 137, 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(62, 180, 137, 0.4);
    border: 3px solid #f0fdf4;
}


/* MODALS */

#custom-modal,
#modal-letters,
#modal-store {
    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 #d1fae5;
    border-radius: 15px;
    margin: 15px 0;
    outline: none;
    background: #f0fdf4;
    resize: vertical;
    min-height: 120px;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
}

.modal-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.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;
}


/* ADMIN UI */

.admin-only {
    display: none !important;
}

body.is-admin .admin-only {
    display: block !important;
}

.admin-box {
    margin-top: 20px;
    padding: 15px;
    background: #f0fdf4;
    border-radius: 15px;
    border: 2px dashed var(--secondary);
    text-align: left;
}

.admin-box h4 {
    margin-bottom: 10px;
    color: var(--secondary);
    font-weight: 800;
    font-size: 0.9rem;
}

.admin-box select,
.admin-box textarea {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #ccc;
    margin-bottom: 10px;
    outline: none;
}

.admin-box textarea {
    resize: vertical;
}


/* THƯ */

.letter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.envelope-item {
    background: white;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: 0.3s;
    border: 2px solid transparent;
    position: relative;
}

.envelope-item:hover {
    transform: translateY(-5px);
    border-color: var(--secondary);
}

.env-icon {
    font-size: 2.5rem;
    color: #a8e6cf;
    margin-bottom: 5px;
}

.env-date {
    font-size: 0.75rem;
    color: #999;
    font-weight: bold;
}

.env-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-del-letter {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 25px;
    height: 25px;
    background: #3eb489;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.btn-del-letter:hover {
    background: #2d6a4f;
    transform: scale(1.1);
}


/* VOUCHER */

.voucher-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 5px;
}

.voucher-card {
    background: white;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: 0.3s;
    border: 1px solid #d1fae5;
}

.voucher-card::before,
.voucher-card::after {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}

.voucher-card::before {
    left: -12px;
}

.voucher-card::after {
    right: -12px;
}

.voucher-left {
    padding: 15px 15px 15px 25px;
    flex: 1;
    text-align: left;
    border-right: 2px dashed #eee;
}

.voucher-title {
    font-weight: 800;
    color: var(--secondary);
    font-size: 1rem;
    margin-bottom: 5px;
}

.voucher-desc {
    font-size: 0.75rem;
    color: #888;
}

.voucher-right {
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

.voucher-count {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--text);
}

.voucher-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    color: #aaa;
    margin-bottom: 5px;
}

.btn-use-voucher {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.btn-use-voucher:active {
    transform: scale(0.95);
}

.voucher-card.out-of-stock {
    opacity: 0.6;
    filter: grayscale(1);
}

.voucher-card.out-of-stock .btn-use-voucher {
    background: #ccc;
    cursor: not-allowed;
}


/* === GACHA PREMIUM UI === */

.gacha-banner {
    width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    position: relative;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(62, 180, 137, 0.4);
    border: 3px solid white;
    text-align: center;
    overflow: hidden;
}

.banner-content {
    position: relative;
    z-index: 2;
    margin-top: 0;
    transform: translateY(10px);
}

.banner-title {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
    color: #fff;
}

.banner-subtitle {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffd700;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    margin-top: 5px;
}

.currency-badge {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 20px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 900;
    color: var(--secondary);
    font-size: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 3;
}

.gacha-btn-group {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.btn-gacha {
    flex: 1;
    background: white;
    border: 2px solid #d1fae5;
    padding: 15px;
    border-radius: 20px;
    font-weight: 800;
    color: var(--text);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: 0.3s;
    box-shadow: 0 5px 15px rgba(168, 230, 207, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-gacha:active {
    transform: scale(0.95);
}

.btn-gacha span {
    font-size: 0.75rem;
    color: #3eb489;
    margin-top: 5px;
    font-weight: bold;
}

.btn-gacha.x10 {
    background: linear-gradient(135deg, #a8e6cf 0%, #3eb489 100%);
    border: none;
    color: white;
    box-shadow: 0 8px 20px rgba(62, 180, 137, 0.4);
}

.btn-gacha.x10 span {
    color: #fff;
    opacity: 0.9;
}

.btn-gacha i {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.btn-gacha:not(.x10) i {
    color: #3eb489;
}

.btn-gacha.x10 i {
    color: white;
}


/* TAB MENU TRONG GACHA */

.gacha-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border-radius: 12px;
    border: none;
    font-weight: bold;
    font-size: 0.8rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.5);
    color: #888;
    transition: 0.3s;
}

.tab-btn.active {
    background: white;
    color: var(--secondary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}


/* DANH SÁCH LỊCH SỬ & TÚI ĐỒ */

.gacha-list-container {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 15px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid white;
}

.history-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #ddd;
    font-size: 0.85rem;
    color: #555;
}

.history-row.r5 {
    color: #d4af37;
    font-weight: bold;
}

.history-row.r4 {
    color: #9c27b0;
}

.history-row.r2 {
    color: #aaa;
    font-style: italic;
    font-size: 0.8rem;
}

.bag-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.bag-item {
    background: white;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: relative;
}

.bag-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.bag-name {
    font-size: 0.7rem;
    font-weight: bold;
    color: #555;
    line-height: 1.2;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.bag-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--secondary);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}


/* --- ANIMATION GACHA --- */

#gacha-animation {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
}

#spinning-layer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.heart-spinner {
    font-size: 80px;
    animation: heartPulse 0.8s infinite alternate;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.5));
    transition: color 0.5s ease, filter 0.5s ease;
}

.heart-spinner.white {
    color: #fff;
    filter: drop-shadow(0 0 15px #fff);
}

.heart-spinner.blue {
    color: #4fc3f7;
    filter: drop-shadow(0 0 25px #4fc3f7);
}

.heart-spinner.purple {
    color: #ab47bc;
    filter: drop-shadow(0 0 30px #ab47bc);
}

.heart-spinner.gold {
    color: #ffca28;
    filter: drop-shadow(0 0 40px #ffca28);
    animation: heartPulse 0.4s infinite alternate;
}

@keyframes heartPulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.2);
        opacity: 1;
    }
}

#result-layer {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-height: 90vh;
}

.result-scroll-container {
    width: 100%;
    max-width: 450px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.result-scroll-container::-webkit-scrollbar {
    display: none;
}

.result-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding-bottom: 20px;
    transition: all 0.3s ease;
}

.result-grid.compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    align-content: start;
}

.gacha-card {
    width: calc(50% - 6px);
    max-width: 180px;
    height: 160px;
    border-radius: 15px;
    padding: 10px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: cardBurst 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.g-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    transition: 0.3s;
}

.g-name {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
    word-break: break-word;
    transition: 0.3s;
}

.result-grid.compact .gacha-card {
    width: 100%;
    max-width: none;
    height: 85px;
    padding: 5px;
    border-radius: 12px;
    flex-direction: row;
    gap: 10px;
    text-align: left;
}

.result-grid.compact .g-icon {
    font-size: 1.8rem;
    margin-bottom: 0;
}

.result-grid.compact .g-name {
    font-size: 0.8rem;
    text-align: left;
}

.gacha-card.r2 {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
}

.gacha-card.r2 .g-name {
    color: #6c757d;
    font-weight: 600;
}

.gacha-card.r3 {
    background: #e3f2fd;
    border: 2px solid #90caf9;
}

.gacha-card.r3 .g-name {
    color: #1565c0;
}

.gacha-card.r4 {
    background: #f3e5f5;
    border: 2px solid #ce93d8;
    box-shadow: 0 0 10px rgba(206, 147, 216, 0.4);
}

.gacha-card.r4 .g-name {
    color: #7b1fa2;
}

.gacha-card.r5 {
    background: #fffde7;
    border: 2px solid #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    transform: scale(1);
    z-index: 5;
}

.gacha-card.r5 .g-name {
    color: #fbc02d;
    text-shadow: 0 0 1px #ffeb3b;
}

.btn-claim {
    margin-top: 15px;
    padding: 12px 50px;
    border-radius: 30px;
    background: linear-gradient(45deg, #a8e6cf, #3eb489);
    color: white;
    font-weight: 900;
    border: none;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(62, 180, 137, 0.4);
    opacity: 0;
    animation: fadeIn 0.5s 1s forwards;
    font-size: 1rem;
    letter-spacing: 1px;
}

@keyframes cardBurst {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}


/* BAO THƯ (WHITE) */

#modal-read-letter {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

.envelope-wrapper {
    position: relative;
    width: 300px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.5s ease;
}

.envelope-wrapper:has(.open) {
    transform: translateY(80px);
}

.envelope {
    position: relative;
    width: 300px;
    height: 180px;
    background: #ccc;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.lid {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border-right: 150px solid transparent;
    border-bottom: 100px solid transparent;
    border-left: 150px solid transparent;
    transform-origin: top;
    transition: transform 0.5s ease;
    z-index: 30;
}

.lid.one {
    border-top: 100px solid #ffffff;
    transform: rotateX(0deg);
}

.envelope.open .lid.one {
    transform: rotateX(180deg);
    z-index: 10;
    transition-delay: 0s;
}

.pocket {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-top: 100px solid transparent;
    border-right: 150px solid #f2f2f2;
    border-bottom: 80px solid #f2f2f2;
    border-left: 150px solid #f2f2f2;
    border-radius: 0 0 10px 10px;
    z-index: 20;
    pointer-events: none;
}

.letter-sheet {
    position: absolute;
    bottom: 0;
    left: 5%;
    width: 90%;
    height: 160px;
    background: #fffdf0;
    background-image: linear-gradient(#eee 1px, transparent 1px);
    background-size: 100% 25px;
    z-index: 15;
    transition: all 0.6s ease-in-out;
    padding: 20px;
    overflow: hidden;
    border-radius: 5px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

.envelope.open .letter-sheet {
    bottom: 0;
    height: 300px;
    transform: translateY(-50px);
    z-index: 40;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition-delay: 0.4s;
    overflow-y: auto;
}

.typing-title {
    font-family: 'Dancing Script', cursive;
    color: #3eb489;
    text-align: center;
    font-size: 1.6rem;
    margin-bottom: 10px;
    min-height: 30px;
    font-weight: bold;
}

.typing-body {
    font-family: 'Dancing Script', cursive;
    font-size: 1.2rem;
    color: #444;
    line-height: 25px;
    white-space: pre-wrap;
}

.typing-footer {
    text-align: right;
    font-size: 0.8rem;
    color: #999;
    margin-top: 15px;
    opacity: 0;
    transition: 1s;
}

.typing-footer.show {
    opacity: 1;
}

.stamp-decoration {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #2d6a4f;
    font-size: 2rem;
    opacity: 0.8;
    transform: rotate(15deg);
    border: 2px solid #a8e6cf;
    padding: 2px 5px;
    border-radius: 4px;
}

.btn-close-letter-fixed {
    position: absolute;
    top: -40px;
    right: 0;
    background: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-weight: bold;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    color: #555;
}


/* PC Mode */

@media (min-width: 1024px) {
    body {
        overflow-y: auto;
        background-image: url('https://www.transparenttextures.com/patterns/cubes.png');
        background-color: #d1fae5;
    }
    #lock-screen {
        z-index: 99999;
    }
    #app {
        display: none;
        max-width: 1000px;
        width: 100%;
        height: auto;
        min-height: 100vh;
        margin: 0 auto;
        padding: 40px 40px 40px 120px;
        background: transparent;
        overflow: visible;
    }
    .greeting {
        font-size: 2.8rem;
        margin-bottom: 40px;
        text-align: center;
        text-shadow: 2px 2px 0px white;
        width: 100%;
        padding-left: 0;
    }
    .status-bar {
        display: none;
    }
    .dock {
        width: 80px;
        height: auto;
        flex-direction: column;
        top: 100px;
        left: calc(50% - 580px);
        bottom: auto;
        transform: none;
        padding: 30px 0;
        gap: 40px;
        border-radius: 40px;
        background: white;
        box-shadow: 5px 10px 20px rgba(62, 180, 137, 0.1);
        position: fixed;
    }
    #tab-home {
        display: grid;
        grid-template-columns: 2fr 1.2fr;
        grid-template-rows: auto auto;
        gap: 25px;
    }
    .weather-box {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
        height: 100%;
        background: white;
    }
    .photo-slider {
        grid-column: 1 / 2;
        grid-row: 1 / 3;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        height: auto;
        overflow: visible;
        padding: 0;
    }
    .slide-item {
        min-width: auto;
        width: 100%;
        height: 180px;
        border-radius: 15px;
    }
    .card:has(.timeline-mini) {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
        height: 100%;
    }
    .timeline-mini {
        max-height: 400px;
    }
    #tab-vip {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 30px;
        align-items: start;
    }
    .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;
    }
    .calendar-container {
        height: 100%;
        min-height: 450px;
        background: white;
    }
    .cal-day {
        font-size: 1rem;
        border-radius: 10px;
    }
}

.check-in-heart {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.6rem;
    color: #3eb489;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.8));
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cal-day.has-note .check-in-heart {
    color: white;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.3));
}


/* --- TAB COUPLE: GÓC BÍ MẬT --- */

.couple-draw-box {
    padding: 15px;
    border: 2px dashed var(--primary);
    background: rgba(255, 255, 255, 0.9);
    transition: 0.3s;
}

.couple-draw-box.fullscreen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: #f0fdf4;
    display: flex;
    flex-direction: column;
    border: none;
    border-radius: 0;
    padding: 20px;
}

.couple-draw-box.fullscreen #coupleCanvas {
    flex: 1;
    height: auto;
}

.draw-tools {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    align-items: center;
}

.btn-mint-soft {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.2s;
}

.btn-mint-soft:active {
    transform: scale(0.95);
}

#coupleCanvas {
    width: 100%;
    height: 300px;
    background: white;
    border-radius: 12px;
    touch-action: none;
    cursor: crosshair;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

.couple-chat-box {
    display: flex;
    flex-direction: column;
    height: 350px;
    padding: 15px;
    margin-top: 15px;
    border: 2px dashed var(--primary);
    background: rgba(255, 255, 255, 0.9);
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
    padding-right: 5px;
}

.chat-msg {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 0.9rem;
    word-break: break-word;
    animation: popIn 0.3s ease;
}

.chat-msg.me {
    align-self: flex-end;
    background: var(--secondary);
    color: white;
    border-bottom-right-radius: 5px;
}

.chat-msg.partner {
    align-self: flex-start;
    background: #f0fdf4;
    color: #2d6a4f;
    border: 1px solid #a8e6cf;
    border-bottom-left-radius: 5px;
}

.chat-input-area {
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #eee;
    border-radius: 20px;
    outline: none;
    font-family: inherit;
}

.chat-input-area input:focus {
    border-color: var(--secondary);
}

.chat-input-area button {
    background: var(--secondary);
    color: white;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    transition: 0.2s;
}

.chat-input-area button:active {
    transform: scale(0.9);
}