/* ===== Quiz - Scroll-based Layout ===== */

/* Override white theme for quiz page (dark background) */
body.quiz-page {
    --bg-primary: #0A0A12;
    --bg-secondary: #10101E;
    --bg-card: #141425;
    --gray: #AAAAAA;
    --gray-dark: #8A8A8A;
    background: #0A0A12;
    color: #AAAAAA;
}

/* ===== FV ===== */
.fv-section {
    display: flex;
    flex-direction: column;
    background: #0A0A12;
}

/* FV Hero Image */
.fv-hero-image {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.fv-hero-img {
    width: 100%;
    height: auto;
    display: block;
}

/* Blurred side bg on wide screens */
.fv-section {
    position: relative;
    overflow: hidden;
}

.fv-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #0A0A12;
    z-index: 0;
}

/* Blur bg set via JS --fv-bg variable */
.fv-blur-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.fv-blur-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(40px) brightness(0.35) saturate(1.2);
    transform: scale(1.2);
}

/* FV Copy Area */
.fv-copy-area {
    position: relative;
    overflow: hidden;
    padding: var(--space-3xl) var(--space-lg) var(--space-2xl);
}

.fv-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 20%, rgba(27, 37, 100, 0.5) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 80%, rgba(212, 42, 42, 0.12) 0%, transparent 45%);
    pointer-events: none;
}

.fv-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
}

/* Badge */
.fv-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--red-bright);
    border: 1px solid rgba(232, 62, 62, 0.4);
    background: rgba(232, 62, 62, 0.08);
    padding: 6px 20px;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-lg);
}

/* Headline */
.fv-headline {
    font-size: clamp(1.625rem, 7vw, 2.25rem);
    font-weight: 900;
    color: var(--white);
    line-height: 1.45;
    margin-bottom: var(--space-md);
    letter-spacing: 0.02em;
}

.fv-accent {
    color: var(--red-bright);
    font-size: 1.15em;
    position: relative;
}

.fv-accent::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 3px;
    background: var(--red);
    border-radius: 2px;
    opacity: 0.5;
}

/* Sub copy */
.fv-sub {
    font-size: 1rem;
    color: #CCCCCC;
    margin-bottom: var(--space-lg);
    line-height: 1.8;
}

.fv-sub strong {
    color: var(--white);
    font-weight: 700;
}

/* Features */
.fv-features {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.fv-feature {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--white);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: var(--radius-full);
}

.fv-feature-dot {
    width: 4px;
    height: 4px;
    background: var(--gray-dark);
    border-radius: 50%;
    flex-shrink: 0;
}

/* Large CTA */
.btn-large {
    padding: 18px 48px;
    font-size: 1.1875rem;
}

/* Scroll hint */
.fv-scroll-hint {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--gray);
    margin-top: var(--space-md);
}

.fv-scroll-arrow {
    color: var(--gray);
    margin-top: var(--space-sm);
    animation: bounceDown 1.5s ease infinite;
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(8px); opacity: 1; }
}

/* ===== FV Bottom Peek Bar ===== */
.fv-peek {
    background: #0A0A12;
    border-top: none;
    padding: 12px var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    cursor: pointer;
    animation: peekPulse 2s ease-in-out infinite;
}

.fv-peek-text {
    font-size: 0.875rem;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 0.03em;
}

.fv-peek-arrow {
    color: var(--red-bright);
    animation: peekBounce 1.5s ease-in-out infinite;
    font-size: 1rem;
}

@keyframes peekBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

@keyframes peekPulse {
    0%, 100% { background: #0A0A12; }
    50% { background: #12122a; }
}

/* ===== Quiz Section ===== */
.quiz-section {
    display: block;
    background: #0A0A12;
    padding-bottom: 40vh;
}

.quiz-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ===== Sticky Progress ===== */
.quiz-progress {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #0A0A12;
    padding: var(--space-md) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.quiz-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4A6AD4, var(--red));
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.quiz-progress-text {
    font-size: 0.75rem;
    color: var(--gray-dark);
    text-align: right;
}

/* ===== Quiz Block ===== */
.quiz-block {
    padding: var(--space-3xl) 0 var(--space-xl);
    opacity: 0.3;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.quiz-block.active {
    opacity: 1;
    pointer-events: auto;
}

.quiz-block.answered {
    opacity: 0.5;
    cursor: pointer;
    pointer-events: auto;
}

.quiz-block.answered .quiz-option {
    pointer-events: none;
}

.quiz-block.answered:hover {
    opacity: 0.7;
}

.quiz-number {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--red-bright);
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.quiz-question {
    font-size: clamp(1.25rem, 5vw, 1.5rem);
    font-weight: 900;
    color: var(--white);
    line-height: 1.4;
    margin-bottom: var(--space-lg);
}

.quiz-note {
    font-size: 0.8125rem;
    color: var(--gray);
    margin-top: calc(-1 * var(--space-sm));
    margin-bottom: var(--space-lg);
}

/* ===== Quiz Options ===== */
.quiz-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.quiz-options-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.quiz-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: var(--space-lg) var(--space-md);
    min-height: 80px;
    background: #141425;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    color: var(--white);
    transition: all 0.25s ease;
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.quiz-options-list .quiz-option {
    flex-direction: row;
    justify-content: center;
    min-height: 56px;
    padding: var(--space-md) var(--space-lg);
}

.quiz-option:hover {
    border-color: var(--red);
    background: rgba(212, 42, 42, 0.08);
    transform: translateY(-2px);
}

.quiz-option:active {
    transform: scale(0.97);
}

.quiz-option:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 2px;
}

.quiz-option.selected {
    border-color: var(--red);
    background: rgba(212, 42, 42, 0.15);
    box-shadow: 0 0 0 1px var(--red);
}

.quiz-option-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.quiz-option-sub {
    font-size: 0.75rem;
    color: var(--gray);
    font-weight: 400;
}

.quiz-options-list .quiz-option-sub {
    display: none;
}

/* ===== Loading ===== */
.loading-section {
    display: none;
    min-height: 100dvh;
    align-items: center;
    justify-content: center;
    background: #0A0A12;
}

.loading-section.active {
    display: flex;
}

.loading-content {
    text-align: center;
    padding: var(--space-xl);
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-xl);
}

.spinner-ring {
    position: absolute;
    inset: 0;
    border: 3px solid transparent;
    border-radius: 50%;
}

.spinner-ring:nth-child(1) {
    border-top-color: var(--red);
    animation: spin 1.2s linear infinite;
}

.spinner-ring:nth-child(2) {
    inset: 8px;
    border-right-color: #4A6AD4;
    animation: spin 1.6s linear infinite reverse;
}

.spinner-ring:nth-child(3) {
    inset: 16px;
    border-bottom-color: var(--red-bright);
    animation: spin 2s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.6;
    margin-bottom: var(--space-xl);
}

.loading-bar {
    width: 200px;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    margin: 0 auto;
    overflow: hidden;
}

.loading-bar-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #4A6AD4, var(--red));
    border-radius: var(--radius-full);
    transition: width 0.1s linear;
}

/* ===== Responsive ===== */

/* --- 414px以下: スマホ全般の調整 --- */
@media (max-width: 414px) {
    /* グリッド → 1カラム切り替え */
    .quiz-options-grid {
        grid-template-columns: 1fr;
    }

    /* プログレスバーstickyが画面幅いっぱいに広がるよう調整 */
    .quiz-progress {
        margin-left: calc(-1 * var(--space-lg));
        margin-right: calc(-1 * var(--space-lg));
        padding-left: var(--space-lg);
        padding-right: var(--space-lg);
    }

    /* FVコピーエリアの余白調整 */
    .fv-copy-area {
        padding: var(--space-2xl) var(--space-md) var(--space-xl);
    }

    /* FV特徴バッジの折り返し対応 */
    .fv-features {
        flex-wrap: wrap;
        gap: var(--space-xs) var(--space-sm);
    }

    .fv-feature-dot {
        display: none;
    }

    /* 見出しサイズ微調整 */
    .fv-headline {
        font-size: clamp(1.5rem, 6.5vw, 2rem);
    }

    /* ボタンの大サイズ調整 */
    .btn-large {
        padding: 16px 32px;
        font-size: 1.0625rem;
        width: 100%;
    }

    /* クイズオプション: タップターゲット48px以上確保 */
    .quiz-option {
        min-height: 56px;
        padding: var(--space-md);
    }

    .quiz-options-list .quiz-option {
        min-height: 52px;
        padding: var(--space-md) var(--space-lg);
    }

    /* クイズブロックの上余白を詰める */
    .quiz-block {
        padding: var(--space-2xl) 0 var(--space-lg);
    }
}

/* --- 360px以下: 小型スマホ (Galaxy S系等) --- */
@media (max-width: 360px) {
    .fv-copy-area {
        padding: var(--space-xl) var(--space-sm) var(--space-lg);
    }

    .fv-headline {
        font-size: 1.375rem;
    }

    .fv-sub {
        font-size: 0.9375rem;
    }

    .fv-badge {
        font-size: 0.6875rem;
        padding: 5px 16px;
    }

    .fv-feature {
        font-size: 0.75rem;
        padding: 3px 10px;
    }

    .quiz-container {
        padding: 0 var(--space-md);
    }

    .quiz-question {
        font-size: 1.1875rem;
    }

    .quiz-option-title {
        font-size: 0.9375rem;
    }
}

/* --- 320px: 最小幅 (iPhone SE 1st gen / iPhone 5) --- */
@media (max-width: 320px) {
    .fv-headline {
        font-size: 1.25rem;
    }

    .fv-sub {
        font-size: 0.875rem;
        line-height: 1.7;
    }

    .fv-features {
        gap: var(--space-xs);
    }

    .fv-feature {
        font-size: 0.6875rem;
        padding: 2px 8px;
    }

    .fv-logo {
        width: 140px;
    }

    .quiz-question {
        font-size: 1.125rem;
    }

    .quiz-option {
        min-height: 52px;
        padding: var(--space-sm) var(--space-md);
    }

    .quiz-option-title {
        font-size: 0.875rem;
    }

    .quiz-option-sub {
        font-size: 0.6875rem;
    }

    .loading-text {
        font-size: 1rem;
    }
}
