/* ==================== 基本設定 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'メイリオ', sans-serif;
    background-color: #FFF5F7;
    color: #4A4A4A;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* スマホでスクロール可能にするため上詰めに変更 */
    padding: 20px 20px 40px; /* 下部に余白を追加 */
}

/* ==================== ローディング画面 ==================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #FFF5F7;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease-out;
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading-title {
    font-size: 28px;
    font-weight: 700;
    color: #FFB6C1;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(255, 182, 193, 0.3);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #FFD4E5;
    border-top: 6px solid #FFB6C1;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 18px;
    color: #FFB6C1;
    margin-bottom: 10px;
    font-weight: 500;
}

.loading-progress {
    font-size: 16px;
    color: #FFA07A;
    font-weight: 700;
}

.container {
    width: 100%;
    max-width: 600px;
    position: relative;
}

/* ==================== メインタイトル ==================== */
.main-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: #FFB6C1;
    margin-bottom: 25px;
    text-shadow: 2px 2px 4px rgba(255, 182, 193, 0.3);
    animation: fadeIn 0.5s ease-in;
    line-height: 1.5;
}

/* ==================== 進捗表示 ==================== */
.progress {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: #FFB6C1;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease-in;
}

/* ==================== 質問画面 ==================== */
.question-screen {
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.character-container {
    text-align: center;
    margin-bottom: 30px;
}

.character-image {
    width: 80%;
    max-width: 400px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(255, 182, 193, 0.3);
}

.question-bubble {
    background: white;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

.question-bubble::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 15px solid white;
}

.question-bubble p {
    font-size: 18px;
    line-height: 1.8;
    font-weight: 500;
    text-align: center;
}

/* ==================== 選択肢 ==================== */
.choices {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.choice-button {
    width: 100%;
    min-height: 60px;
    padding: 15px 20px;
    background: #FFD4E5;
    border: 3px solid #FFB6C1;
    border-radius: 15px;
    font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #4A4A4A;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: left;
    line-height: 1.5;
}

.choice-button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 182, 193, 0.4);
}

.choice-button:active {
    transform: scale(0.98);
}

/* ==================== 結果画面 ==================== */
.result-screen {
    text-align: center;
    animation: resultFadeIn 0.8s ease-out;
}

.result-screen.hidden {
    display: none;
}

.result-content {
    background: white;
    border-radius: 25px;
    padding: 40px 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.result-label {
    font-size: 20px;
    margin-bottom: 15px;
    color: #4A4A4A;
}

.result-percentage {
    font-size: 56px;
    font-weight: 700;
    color: #FFB6C1;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(255, 182, 193, 0.3);
}

.result-comment {
    font-size: 22px;
    font-weight: 500;
    color: #87CEEB;
    line-height: 1.6;
}

/* ==================== 問いかけテキスト ==================== */
.call-to-action {
    margin: 25px 0;
    text-align: center;
}

.cta-question {
    font-size: 24px;
    font-weight: 700;
    color: #FF69B4;
    text-shadow: 2px 2px 4px rgba(255, 105, 180, 0.2);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.85;
        transform: scale(1.02);
    }
}

/* ==================== アクションボタン ==================== */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.main-actions {
    display: flex;
    flex-direction: row;
    gap: 15px;
    width: 100%;
    max-width: 600px;
    justify-content: center;
}

.btn {
    flex: 1;
    min-width: 0;
    height: 80px;
    border: none;
    border-radius: 20px;
    font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    position: relative;
    padding: 15px;
    line-height: 1.4;
}

.btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: scale(0.98);
}

.btn-twitter {
    background: #1DA1F2;
    box-shadow: 0 5px 15px rgba(29, 161, 242, 0.3);
}

.btn-trial {
    background: linear-gradient(135deg, #FFB6C1 0%, #FFA07A 100%);
    box-shadow: 0 5px 20px rgba(255, 182, 193, 0.5);
    animation: poyopoyo 1.5s infinite ease-in-out, shake 3s infinite;
}

.free-badge {
    display: inline-block;
    background: #FF1493;
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: 5px;
    box-shadow: 0 2px 8px rgba(255, 20, 147, 0.4);
}

/* 再診断テキストリンク */
.btn-retry-text {
    background: none;
    border: none;
    color: #9E9E9E;
    font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
    padding: 10px;
}

.btn-retry-text:hover {
    color: #FFB6C1;
}

/* ==================== アニメーション ==================== */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes resultFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes poyopoyo {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shake {
    0%, 85%, 100% {
        transform: translateX(0) scale(1);
    }
    87% {
        transform: translateX(-8px) scale(1.05);
    }
    89% {
        transform: translateX(8px) scale(1.05);
    }
    91% {
        transform: translateX(-8px) scale(1.05);
    }
    93% {
        transform: translateX(8px) scale(1.05);
    }
    95% {
        transform: translateX(-4px) scale(1.05);
    }
    97% {
        transform: translateX(4px) scale(1.05);
    }
}

/* ==================== 隠し要素 ==================== */
.hidden {
    display: none !important;
}

/* ==================== レスポンシブ対応 ==================== */
/* スマホ（デフォルト: 〜767px） */
@media (max-width: 767px) {
    body {
        padding: 10px 15px 30px; /* パディングを調整 */
    }

    .main-title {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .progress {
        margin-bottom: 15px;
    }

    .character-container {
        margin-bottom: 20px;
    }

    .character-image {
        width: 70%; /* 画像を少し小さく */
        max-width: 280px;
    }

    .question-bubble {
        padding: 20px;
        margin-bottom: 20px;
    }

    .question-bubble p {
        font-size: 15px;
    }

    .choices {
        gap: 10px; /* 選択肢間の余白を減らす */
    }

    .choice-button {
        font-size: 14px;
        min-height: 50px; /* 高さを少し減らす */
        padding: 12px 15px;
    }

    .result-content {
        padding: 30px 20px;
        margin-bottom: 20px;
    }

    .result-label {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .result-percentage {
        font-size: 44px;
        margin-bottom: 10px;
    }

    .result-comment {
        font-size: 17px;
    }

    .call-to-action {
        margin: 20px 0;
    }

    .cta-question {
        font-size: 19px;
    }

    /* スマホでは縦積み */
    .main-actions {
        flex-direction: column;
        gap: 10px;
    }

    .btn {
        font-size: 14px;
        height: 65px;
        width: 100%;
    }

    .free-badge {
        font-size: 11px;
        padding: 2px 6px;
    }

    .btn-retry-text {
        font-size: 14px;
        padding: 8px;
    }
}

/* タブレット・PC（768px〜） */
@media (min-width: 768px) {
    body {
        padding: 40px;
        align-items: center; /* PC/タブレットでは中央配置に戻す */
    }

    .container {
        max-width: 650px;
    }

    .main-title {
        font-size: 32px;
        margin-bottom: 30px;
    }

    .character-image {
        max-width: 500px;
    }

    .question-bubble {
        padding: 35px;
        margin-bottom: 40px;
    }

    .question-bubble p {
        font-size: 20px;
    }

    .choice-button {
        font-size: 17px;
        padding: 18px 25px;
    }

    .result-content {
        padding: 50px 40px;
    }

    .result-label {
        font-size: 22px;
    }

    .result-percentage {
        font-size: 64px;
    }

    .result-comment {
        font-size: 24px;
    }

    .cta-question {
        font-size: 28px;
    }

    .action-buttons {
        gap: 25px;
    }

    .btn {
        font-size: 17px;
        height: 85px;
    }

    .free-badge {
        font-size: 13px;
        padding: 4px 10px;
    }

    .btn-retry-text {
        font-size: 17px;
    }
}

/* 大画面（1200px〜） */
@media (min-width: 1200px) {
    .container {
        max-width: 700px;
    }

    .character-image {
        max-width: 600px;
    }
}

/* ==================== 花火エフェクト ==================== */
.confetti-piece {
    position: fixed;
    width: 10px;
    height: 10px;
    opacity: 0;
    z-index: 10000;
    pointer-events: none;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti-piece.fall {
    animation: confetti-fall 3s ease-out forwards;
}

/* ==================== 雨エフェクト ==================== */
.rain-drop {
    position: fixed;
    width: 2px;
    height: 20px;
    opacity: 0;
    z-index: 10000;
    pointer-events: none;
}

@keyframes rain-fall {
    0% {
        transform: translateY(0);
        opacity: 0.6;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

.rain-drop.fall {
    animation: rain-fall 1.5s linear forwards;
}
