/* 魔法の森 いきもの診断アプリ - カスタムスタイル */

:root {
    --primary-blue: #64B9FA;
    --accent-orange: #FA7525;
    --magical-purple: #9B59B6;
    --forest-green: #27AE60;
    --fairy-pink: #FF69B4;
    --unicorn-white: #F8F9FA;
    --shadow-soft: 0 8px 32px rgba(100, 185, 250, 0.3);
    --shadow-magical: 0 12px 40px rgba(155, 89, 182, 0.4);
    --gradient-magical: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-forest: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

body {
    font-family: 'Noto Sans JP', 'Fredoka', sans-serif;
    overflow-x: hidden;
    /* パフォーマンス最適化 */
    will-change: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* GPU加速を活用 */
.fade-in-up, .float, .sparkle {
    will-change: transform, opacity;
    transform: translateZ(0); /* GPU加速を有効化 */
}

/* 画像の最適化 */
img {
    max-width: 100%;
    height: auto;
    /* 画像の読み込み最適化 */
    image-rendering: auto;
    /* WebP対応のためのフォールバック */
    background-size: cover;
    background-position: center;
}

/* 画像読み込み時のスムーズなトランジション */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* カスタムアニメーション */
@keyframes sparkle {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
        opacity: 0.8;
    }
    50% { 
        transform: scale(1.2) rotate(180deg);
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px);
    }
    50% { 
        transform: translateY(-10px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(100, 185, 250, 0.5);
    }
    50% {
        box-shadow: 0 0 30px rgba(100, 185, 250, 0.8);
    }
}

/* アニメーションクラス */
.sparkle {
    animation: sparkle 3s infinite;
}

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

.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.pulse-glow {
    animation: pulse-glow 2s infinite;
}

/* 魔法的エフェクト */
.magical-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: var(--shadow-magical);
    transition: all 0.3s ease;
}

.magical-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(155, 89, 182, 0.3);
}

/* ボタンスタイル */
.magical-button {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--magical-purple) 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.magical-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 45px rgba(100, 185, 250, 0.4);
}

.magical-button:active {
    transform: translateY(0);
}

.cta-button {
    background: linear-gradient(135deg, var(--accent-orange) 0%, #FF6B35 100%);
    color: white;
    border: none;
    padding: 20px 40px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(250, 117, 37, 0.4);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-block;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(250, 117, 37, 0.5);
}

/* 選択肢ボタン */
.choice-button {
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(248,249,250,0.8) 100%);
    border: 2px solid var(--primary-blue);
    color: #333;
    padding: 16px 20px;
    border-radius: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
    margin: 8px 0;
    backdrop-filter: blur(10px);
}

.choice-button:hover {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--magical-purple) 100%);
    color: white;
    transform: translateX(10px);
    box-shadow: var(--shadow-soft);
}

/* 結果画像のスタイル */
.result-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 4px solid var(--primary-blue);
    box-shadow: var(--shadow-magical);
    object-fit: cover;
    animation: float 4s ease-in-out infinite;
}

/* プログレスバー */
.progress-bar {
    background: linear-gradient(90deg, var(--primary-blue) 0%, var(--magical-purple) 100%);
    height: 6px;
    border-radius: 3px;
    transition: width 0.5s ease;
    box-shadow: 0 2px 10px rgba(100, 185, 250, 0.3);
}

/* SNSボタン */
.sns-button {
    padding: 12px 20px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    line-height: 1.2;
}

.sns-button:hover {
    transform: translateY(-2px);
}

.twitter-button {
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
    color: white;
}

.line-button {
    background: linear-gradient(135deg, #00C300 0%, #00a000 100%);
    color: white;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .magical-button {
        padding: 14px 28px;
        font-size: 16px;
        min-height: 48px; /* タッチに適したサイズ */
    }
    
    .choice-button {
        padding: 16px;
        font-size: 15px;
        min-height: 56px; /* タッチに適したサイズ */
        line-height: 1.4;
    }
    
    .magical-card {
        margin: 16px;
        padding: 20px;
    }
    
    .sns-button {
        padding: 10px 16px;
        font-size: 14px;
        min-width: 80px;
    }
    
    /* 画像の最適化 */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* より小さな画面対応 */
    @media (max-width: 480px) {
        .magical-title {
            font-size: 1.4rem;
            line-height: 1.3;
        }
        
        .choice-button {
            padding: 12px;
            font-size: 14px;
            margin: 6px 0;
        }
        
        /* カードの余白調整 */
        .magical-card {
            margin: 12px;
            padding: 16px;
        }
    }
}

/* 特殊エフェクト */
.magical-glow {
    position: relative;
}

.magical-glow::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-blue), var(--magical-purple), var(--fairy-pink), var(--primary-blue));
    border-radius: inherit;
    z-index: -1;
    animation: pulse-glow 3s infinite;
    opacity: 0.7;
}

/* タイトル装飾 */
.magical-title {
    background: linear-gradient(135deg, var(--magical-purple) 0%, var(--primary-blue) 50%, var(--fairy-pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Fredoka', 'Noto Sans JP', sans-serif;
    line-height: 1.4;
    letter-spacing: 0.05em;
    white-space: nowrap;
    text-align: center;
    display: block;
}