/* ==========================================================================
   達成演出（Celebration）スタイル - ダークテーマ・プレミアム演出
   ========================================================================== */

/* --------------------------------------------------------------------------
   コンフェッティアニメーション（レガシー互換 - effects.jsの動的スタイルで上書き）
   -------------------------------------------------------------------------- */

@keyframes confetti-fall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 1;
    }
    25% {
        transform: translateY(25vh) translateX(calc(var(--drift) * 0.3)) rotate(calc(var(--rotation) * 0.5));
        opacity: 0.95;
    }
    50% {
        transform: translateY(50vh) translateX(calc(var(--drift) * 0.7)) rotate(var(--rotation));
        opacity: 0.8;
    }
    75% {
        transform: translateY(75vh) translateX(var(--drift)) rotate(calc(var(--rotation) * 1.5));
        opacity: 0.5;
    }
    100% {
        transform: translateY(105vh) translateX(calc(var(--drift) * 1.1)) rotate(calc(var(--rotation) * 2));
        opacity: 0;
    }
}

/* --------------------------------------------------------------------------
   カードポップアップ
   -------------------------------------------------------------------------- */

@keyframes celebration-popup {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.06);
        opacity: 1;
    }
    70% {
        transform: scale(0.97);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes celebration-glow-gold {
    0%, 100% {
        box-shadow: 0 0 30px rgba(245, 158, 11, 0.15),
                    0 0 60px rgba(245, 158, 11, 0.05),
                    inset 0 0 30px rgba(245, 158, 11, 0.03);
    }
    50% {
        box-shadow: 0 0 50px rgba(245, 158, 11, 0.25),
                    0 0 100px rgba(245, 158, 11, 0.1),
                    inset 0 0 40px rgba(245, 158, 11, 0.05);
    }
}

@keyframes celebration-glow-blue {
    0%, 100% {
        box-shadow: 0 0 30px rgba(37, 99, 235, 0.15),
                    0 0 60px rgba(37, 99, 235, 0.05),
                    inset 0 0 30px rgba(37, 99, 235, 0.03);
    }
    50% {
        box-shadow: 0 0 50px rgba(37, 99, 235, 0.25),
                    0 0 100px rgba(37, 99, 235, 0.1),
                    inset 0 0 40px rgba(37, 99, 235, 0.05);
    }
}

@keyframes celebration-glow-rose {
    0%, 100% {
        box-shadow: 0 0 30px rgba(225, 29, 72, 0.15),
                    0 0 60px rgba(225, 29, 72, 0.05),
                    inset 0 0 30px rgba(225, 29, 72, 0.03);
    }
    50% {
        box-shadow: 0 0 50px rgba(225, 29, 72, 0.25),
                    0 0 100px rgba(225, 29, 72, 0.1),
                    inset 0 0 40px rgba(225, 29, 72, 0.05);
    }
}

@keyframes pulse-rate {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 0 30px rgba(245, 158, 11, 0.4);
    }
    50% {
        transform: scale(1.04);
        text-shadow: 0 0 50px rgba(245, 158, 11, 0.7);
    }
}

@keyframes icon-ring-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.3;
    }
}

@keyframes card-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.01);
    }
}

/* --------------------------------------------------------------------------
   オーバーレイ
   -------------------------------------------------------------------------- */

.celebration-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
}

/* 背景（ダーク半透明 + ラジアルグラデーション） */
.celebration-backdrop {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background-color 0.5s ease;
}

.celebration-backdrop--target {
    background: radial-gradient(ellipse at center, rgba(245, 158, 11, 0.08) 0%, rgba(10, 14, 39, 0.85) 70%);
}

.celebration-backdrop--ranking {
    background: radial-gradient(ellipse at center, rgba(37, 99, 235, 0.08) 0%, rgba(10, 14, 39, 0.85) 70%);
}

.celebration-backdrop--record {
    background: radial-gradient(ellipse at center, rgba(225, 29, 72, 0.08) 0%, rgba(10, 14, 39, 0.85) 70%);
}

/* --------------------------------------------------------------------------
   パーティクル
   -------------------------------------------------------------------------- */

.confetti-particle {
    position: absolute;
    pointer-events: none;
    will-change: transform, opacity;
}

/* --------------------------------------------------------------------------
   メッセージカード（グラスモーフィズム）
   -------------------------------------------------------------------------- */

.celebration-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 3.5rem 2.5rem;
    border-radius: 2rem;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    max-width: 440px;
    width: 90vw;
    animation: celebration-popup 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
               card-pulse 3s ease-in-out 1s infinite;
}

/* 目標達成カード - ゴールド */
.celebration-card--target {
    background: linear-gradient(135deg,
        rgba(245, 158, 11, 0.08) 0%,
        rgba(217, 119, 6, 0.12) 50%,
        rgba(245, 158, 11, 0.06) 100%);
    border: 1px solid rgba(245, 158, 11, 0.25);
    animation: celebration-popup 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
               celebration-glow-gold 2.5s ease-in-out infinite,
               card-pulse 3s ease-in-out 1s infinite;
}

.celebration-card--target .celebration-title {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.4));
}

/* ランキング上昇カード - ブルー */
.celebration-card--ranking {
    background: linear-gradient(135deg,
        rgba(37, 99, 235, 0.08) 0%,
        rgba(59, 130, 246, 0.12) 50%,
        rgba(37, 99, 235, 0.06) 100%);
    border: 1px solid rgba(37, 99, 235, 0.25);
    animation: celebration-popup 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
               celebration-glow-blue 2.5s ease-in-out infinite,
               card-pulse 3s ease-in-out 1s infinite;
}

.celebration-card--ranking .celebration-title {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(37, 99, 235, 0.4));
}

/* 新記録カード - ローズ/ゴールド */
.celebration-card--record {
    background: linear-gradient(135deg,
        rgba(225, 29, 72, 0.08) 0%,
        rgba(245, 158, 11, 0.1) 50%,
        rgba(225, 29, 72, 0.06) 100%);
    border: 1px solid rgba(225, 29, 72, 0.25);
    animation: celebration-popup 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
               celebration-glow-rose 2.5s ease-in-out infinite,
               card-pulse 3s ease-in-out 1s infinite;
}

.celebration-card--record .celebration-title {
    background: linear-gradient(135deg, #fb7185 0%, #e11d48 50%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(225, 29, 72, 0.4));
}

/* --------------------------------------------------------------------------
   アイコンリング
   -------------------------------------------------------------------------- */

.celebration-icon {
    animation: celebration-popup 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}

.celebration-icon-ring {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.celebration-icon-ring::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    animation: icon-ring-pulse 2s ease-in-out infinite;
}

.celebration-icon-ring--gold {
    background: rgba(245, 158, 11, 0.1);
    border: 2px solid rgba(245, 158, 11, 0.3);
}

.celebration-icon-ring--gold::before {
    border: 2px solid rgba(245, 158, 11, 0.2);
}

.celebration-icon-ring--blue {
    background: rgba(37, 99, 235, 0.1);
    border: 2px solid rgba(37, 99, 235, 0.3);
}

.celebration-icon-ring--blue::before {
    border: 2px solid rgba(37, 99, 235, 0.2);
}

.celebration-icon-ring--rose {
    background: rgba(225, 29, 72, 0.1);
    border: 2px solid rgba(225, 29, 72, 0.3);
}

.celebration-icon-ring--rose::before {
    border: 2px solid rgba(225, 29, 72, 0.2);
}

/* --------------------------------------------------------------------------
   テキストスタイル
   -------------------------------------------------------------------------- */

.celebration-title {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    line-height: 1.2;
}

.celebration-message {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    color: rgba(241, 245, 249, 0.7);
    line-height: 1.5;
}

.celebration-name {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(148, 163, 184, 0.8);
    letter-spacing: 0.04em;
}

.celebration-rate {
    display: inline-block;
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse-rate 2s ease-in-out infinite;
    letter-spacing: -0.02em;
}

.celebration-rank {
    display: inline-block;
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

/* --------------------------------------------------------------------------
   レスポンシブ調整
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
    .celebration-card {
        padding: 2rem 1.75rem 1.75rem;
        border-radius: 1.5rem;
    }

    .celebration-title {
        font-size: 1.5rem;
    }

    .celebration-rate {
        font-size: 2.25rem;
    }

    .celebration-rank {
        font-size: 2rem;
    }

    .celebration-icon-ring {
        width: 64px;
        height: 64px;
    }

    .celebration-icon-ring svg {
        width: 40px;
        height: 40px;
    }
}

/* --------------------------------------------------------------------------
   大画面（TV/モニター）最適化
   -------------------------------------------------------------------------- */

@media (min-width: 1920px) {
    .celebration-card {
        max-width: 560px;
        padding: 3.5rem 4.5rem 3rem;
        border-radius: 2.5rem;
    }

    .celebration-title {
        font-size: 2.5rem;
    }

    .celebration-rate {
        font-size: 4rem;
    }

    .celebration-rank {
        font-size: 3rem;
    }

    .celebration-icon-ring {
        width: 100px;
        height: 100px;
    }
}
