@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes bounce-subtle {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10% {
        transform: translate(-2px, -1px) rotate(-1deg);
    }

    30% {
        transform: translate(3px, 2px) rotate(0deg);
    }

    50% {
        transform: translate(-1px, -1px) rotate(1deg);
    }

    70% {
        transform: translate(3px, 1px) rotate(-1deg);
    }

    90% {
        transform: translate(-2px, 2px) rotate(0deg);
    }
}

.shake {
    animation: shake 0.1s ease-in-out infinite;
}

/* より重厚な振動（黒閃用） */
@keyframes heavyShake {

    0%,
    100% {
        transform: translate(0, 0);
    }

    10% {
        transform: translate(-12px, -8px) skew(3deg);
    }

    30% {
        transform: translate(15px, 10px) skew(-3deg);
    }

    50% {
        transform: translate(-10px, -12px);
    }

    70% {
        transform: translate(12px, 8px) skew(2deg);
    }

    90% {
        transform: translate(-8px, 10px);
    }
}

.animate-heavy-shake {
    animation: heavyShake 0.1s ease-in-out infinite;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.card-appear {
    animation: cardIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* カスタムスクロールバー */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* 背景画像の設定修正 */
#bg-overlay {
    position: fixed;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -5;
    opacity: 0.25;
}

/* 黒閃（こくせん）演出 - 白背景（チラつき防止のため最後まで維持） */
@keyframes kokusenLines {
    0% {
        opacity: 0;
    }

    5% {
        opacity: 1;
    }

    100% {
        opacity: 1;
    }
}

/* 画像自体の透明度グラデーション（最後の一瞬だけ強烈に輝くサブリミナル演出） */
@keyframes imageFocus {
    0% {
        opacity: 0;
        transform: scale(0.85);
    }

    20% {
        opacity: 0.03;
    }

    40% {
        opacity: 0.08;
    }

    60% {
        opacity: 0.15;
    }

    80% {
        opacity: 0.22;
    }

    /* 99%までは薄暗い質感を維持 */
    99% {
        opacity: 0.25;
        transform: scale(0.98);
        filter: contrast(110%) brightness(1.1);
    }

    /* 99.5%で一瞬だけ最大輝度（サブリミナル・フラッシュ） */
    99.5% {
        opacity: 1;
        transform: scale(1.05);
        filter: contrast(200%) brightness(2.5);
    }

    100% {
        opacity: 1;
        transform: scale(1.05);
    }
}

#effect-focus {
    position: fixed;
    inset: 0;
    z-index: 900;
    pointer-events: none;
    opacity: 0;
    background-color: black;
    display: flex;
    align-items: center;
    justify-content: center;
}

#effect-focus::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('assets/effect.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    filter: contrast(110%) brightness(1.1);
}

.animate-focus {
    animation: kokusenLines 2.3s forwards;
}

.animate-focus::before {
    animation: imageFocus 2.3s ease-in forwards;
}

/* 黒閃インパクト（決定時） */
@keyframes kokusenFlash {
    0% {
        opacity: 0;
        background-color: black;
    }

    20% {
        opacity: 1;
        background-color: white;
    }

    40% {
        background-color: black;
    }

    100% {
        opacity: 0;
        background-color: white;
    }
}

#effect-flash {
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
}

.animate-kokusen-flash {
    animation: kokusenFlash 0.6s ease-out forwards;
}

/* チェックボックスのカスタム演出 */
.checkbox-custom {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background-color: white;
}

.checkbox-custom.checked {
    background-color: #22c55e;
    border-color: #22c55e;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 10px 15px -3px rgba(34, 197, 94, 0.2);
}

.quest-card {
    background-color: white;
    padding: 1.25rem;
    border-radius: 1.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.quest-card:active {
    transform: scale(0.97);
}

.quest-card.done {
    background-color: #f9fafb;
    opacity: 0.7;
}

.quest-card.done .quest-text {
    text-decoration: line-through;
    color: #9ca3af;
}

/* FABの影調整 */
#btn-fab-add {
    box-shadow: 0 20px 25px -5px rgba(249, 115, 22, 0.3);
}

@keyframes bounce-subtle {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.animate-bounce-subtle {
    animation: bounce-subtle 2s ease-in-out infinite;
}

#tutorial-bubble {
    filter: drop-shadow(0 25px 50px -12px rgba(0, 0, 0, 0.15));
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#tutorial-arrow.top {
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    border-bottom: none;
    border-right: none;
}

#tutorial-arrow.bottom {
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    border-top: none;
    border-left: none;
}

#tutorial-arrow.left {
    left: -8px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    border-top: none;
    border-right: none;
}

#tutorial-arrow.right {
    right: -8px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    border-bottom: none;
    border-left: none;
}