/**
 * KSP.CITY Emotion Drift Styles (A-65)
 * 感情層の可視化 - 背景とテキストの動的変化
 */

:root {
    --emotion-hue: 200;
    --emotion-saturation: 0.4;
}

/* 感情オーバーレイ - 画面全体の色彩変化 */
.emotion-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -2; /* plasma-bg(-1)より下 */

    /* 6秒かけてなめらかに変化 */
    transition: background 6s cubic-bezier(0.4, 0, 0.2, 1);

    /* 微妙な明度・彩度調整 */
    filter: brightness(1.05) saturate(var(--emotion-saturation, 0.5));
}

/* 感情フレーズテキスト */
.emotion-text {
    display: none !important; /* 完全非表示 */
}

.emotion-text.visible {
    opacity: 1;
}

/* 感情フレーズ背景のぼかし効果 */
.emotion-text::before {
    content: "";
    position: absolute;
    inset: -8px;
    background: radial-gradient(
        ellipse at center,
        rgba(10, 20, 35, 0.3) 0%,
        transparent 70%
    );
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 12px;
    z-index: -1;
}

/* フェードインアウトアニメーション（20秒周期） */
@keyframes emotionFadeInOut {
    0%, 90%, 100% {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }
    20%, 70% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .emotion-text {
        top: 45%;
        font-size: clamp(0.85rem, 2.2vw, 1.1rem);
        max-width: 92%;
        padding: 0.4rem 1.2rem;
    }
}

@media (max-width: 480px) {
    .emotion-text {
        top: 40%;
        font-size: clamp(0.8rem, 2.5vw, 1rem);
        max-width: 94%;
        padding: 0.3rem 1rem;
        line-height: 1.6;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .emotion-text {
        color: rgba(255, 255, 255, 0.8);
        text-shadow:
            0 0 5px rgba(0, 255, 255, 0.4),
            0 0 10px rgba(0, 212, 255, 0.3);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .emotion-overlay {
        transition: background 2s linear;
    }
    .emotion-text {
        transition: opacity 1.5s linear;
    }
}

/* Print styles */
@media print {
    .emotion-overlay,
    .emotion-text {
        display: none;
    }
}
