.idle-chest-home-slot {
    position: relative;
    width: 100%;
    min-width: 0;
    z-index: 1;
}

.idle-chest-fold {
    display: none;
}

.idle-chest-panel {
    display: block;
}

.idle-chest-widget {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(180, 140, 255, 0.55);
    border-radius: 16px;
    background:
        radial-gradient(circle at 18% 20%, rgba(120, 80, 255, 0.28), transparent 52%),
        radial-gradient(circle at 82% 88%, rgba(0, 255, 220, 0.18), transparent 55%),
        linear-gradient(145deg, rgba(18, 10, 36, 0.96), rgba(8, 14, 32, 0.94));
    color: #ebe6ff;
    box-shadow:
        0 0 0 1px rgba(200, 170, 255, 0.22) inset,
        0 8px 22px rgba(0, 0, 0, 0.45);
    cursor: default;
    text-align: left;
    overflow: hidden;
    isolation: isolate;
}

.idle-chest-widget__glow {
    position: absolute;
    inset: -20%;
    background: radial-gradient(circle, rgba(255, 220, 120, 0.22), transparent 62%);
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

.idle-chest-widget.is-ready .idle-chest-widget__glow {
    opacity: 1;
    animation: idle-chest-glow 1.4s ease-in-out infinite;
}

.idle-chest-widget.is-ready {
    border-color: rgba(255, 215, 120, 0.85);
    cursor: pointer;
    animation: idle-chest-bounce 1.1s ease-in-out infinite;
}

.idle-chest-widget.is-ready:not(:disabled):hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.idle-chest-widget.is-full {
    opacity: 0.72;
    border-color: rgba(140, 140, 160, 0.45);
}

.idle-chest-widget__icon {
    position: relative;
    z-index: 1;
    font-size: 1.65rem;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(255, 200, 80, 0.45));
}

.idle-chest-widget.is-ready .idle-chest-widget__icon {
    animation: idle-chest-icon-shine 0.9s ease-in-out infinite;
}

.idle-chest-widget__body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 0;
    text-align: center;
}

.idle-chest-widget__title {
    font-family: Orbitron, 'Noto Sans TC', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(200, 180, 255, 0.92);
    text-transform: uppercase;
}

.idle-chest-widget__timer {
    font-family: Orbitron, 'Noto Sans TC', sans-serif;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #fff;
    text-shadow: 0 0 14px rgba(120, 220, 255, 0.45);
    width: 100%;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.idle-chest-widget.is-ready .idle-chest-widget__timer {
    color: #ffe08a;
    text-shadow: 0 0 18px rgba(255, 200, 80, 0.65);
}

.idle-chest-widget__hint {
    font-size: 11px;
    line-height: 1.35;
    color: rgba(200, 195, 230, 0.82);
}

.idle-chest-widget.is-ready .idle-chest-widget__hint {
    color: #ffe9a8;
    font-weight: 700;
}

.idle-chest-widget__badge {
    position: relative;
    z-index: 1;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #1a1030;
    background: linear-gradient(135deg, #c4b5fd, #8b5cf6);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.45);
}

.idle-chest-burst {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: radial-gradient(circle at center, rgba(20, 8, 40, 0.55), rgba(0, 0, 0, 0.72));
    opacity: 0;
    transition: opacity 0.25s ease;
}

.idle-chest-burst.is-active {
    opacity: 1;
    pointer-events: auto;
}

.idle-chest-burst__inner {
    text-align: center;
    padding: 28px 36px;
    border-radius: 22px;
    border: 1px solid rgba(255, 215, 140, 0.65);
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 220, 120, 0.25), transparent 58%),
        linear-gradient(160deg, rgba(36, 16, 58, 0.98), rgba(12, 8, 28, 0.98));
    box-shadow:
        0 0 48px rgba(255, 200, 80, 0.45),
        0 16px 40px rgba(0, 0, 0, 0.55);
    transform: scale(0.82);
    animation: idle-chest-burst-pop 0.55s cubic-bezier(0.2, 1.2, 0.3, 1) forwards;
}

.idle-chest-burst__icon {
    display: block;
    font-size: 2.4rem;
    margin-bottom: 8px;
    animation: idle-chest-icon-shine 0.8s ease-in-out infinite;
}

.idle-chest-burst__title {
    margin: 0 0 8px;
    font-family: Orbitron, 'Noto Sans TC', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffe9a8;
    text-shadow: 0 0 16px rgba(255, 200, 80, 0.55);
}

.idle-chest-burst__reward {
    margin: 0 0 18px;
    font-size: 1rem;
    font-weight: 700;
    color: #e8f4ff;
}

.idle-chest-burst__confirm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    padding: 12px 28px;
    border: 1px solid rgba(255, 215, 140, 0.75);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 200, 80, 0.95), rgba(255, 140, 40, 0.88));
    color: #2a1400;
    font-family: Orbitron, 'Noto Sans TC', sans-serif;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.06em;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(255, 160, 40, 0.45);
    transition: filter 0.15s ease, transform 0.12s ease;
}

.idle-chest-burst__confirm:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.idle-chest-burst__confirm:active {
    transform: translateY(0);
}

@keyframes idle-chest-glow {
    0%,
    100% {
        opacity: 0.45;
        transform: scale(0.95);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

@keyframes idle-chest-bounce {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

@keyframes idle-chest-icon-shine {
    0%,
    100% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 8px rgba(255, 200, 80, 0.45));
    }
    50% {
        transform: scale(1.12) rotate(-6deg);
        filter: drop-shadow(0 0 16px rgba(255, 230, 140, 0.85));
    }
}

@keyframes idle-chest-burst-pop {
    0% {
        transform: scale(0.72);
        opacity: 0;
    }
    70% {
        transform: scale(1.06);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 720px) {
    .idle-chest-fold {
        display: none;
    }

    .idle-chest-panel {
        display: block;
    }

    .idle-chest-widget {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 8px 12px;
        border-width: 1px;
        border-radius: 12px;
        background: linear-gradient(155deg, rgba(16, 10, 34, 0.96), rgba(8, 12, 28, 0.94));
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.05) inset,
            0 4px 16px rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .idle-chest-widget.is-ready {
        border-color: rgba(255, 210, 100, 0.85);
    }

    .idle-chest-widget__icon {
        font-size: 1.35rem;
    }

    .idle-chest-widget__body {
        align-items: center;
        gap: 1px;
        min-width: 0;
    }

    .idle-chest-widget__title {
        font-size: 10px;
        letter-spacing: 0.06em;
    }

    .idle-chest-widget__timer {
        font-size: 16px;
        font-weight: 800;
        line-height: 1.15;
        text-align: center;
    }

    .idle-chest-widget__hint {
        font-size: 9px;
        line-height: 1.25;
        color: rgba(200, 195, 230, 0.78);
    }

    .idle-chest-widget__badge {
        padding: 3px 7px;
        font-size: 9px;
        align-self: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .idle-chest-widget.is-ready,
    .idle-chest-widget.is-ready .idle-chest-widget__icon,
    .idle-chest-widget.is-ready .idle-chest-widget__glow,
    .idle-chest-fold.is-ready,
    .idle-chest-burst__icon {
        animation: none;
    }
}
