@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    z-index: -2;
    top: 0;
    left: 0;
}

canvas {
    display: block;
    vertical-align: bottom;
}

:root {
    --primary: #1a1a1a;
    --secondary: #404040;
    --tertiary: #6b7280;
    --accent: #2563eb;
    --accent-soft: rgba(37, 99, 235, 0.08);
    --success: #059669;
    --warning: #d97706;
    --error: #dc2626;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-dark: #0f172a;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-inverse: #ffffff;
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-dark: #94a3b8;
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
    background: transparent;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    letter-spacing: -0.025em;
    font-weight: 400;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(37, 99, 235, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(15, 23, 42, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(100, 116, 139, 0.02) 0%, transparent 50%);
    z-index: -1;
}

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    padding: 2rem;
}

.container.centered {
    display: flex;
    align-items: center;
    justify-content: center;
}

.container:not(.centered) {
    padding: 3rem 2rem;
}

/* ===== Quiz Container ===== */
.quiz-container {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    border: none;
    position: relative;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.quiz-container.with-background {
    background: var(--bg-primary);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.quiz-container.with-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

/* ===== Start Screen ===== */
.start-screen {
    padding: 2rem;
    text-align: center;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
}

.start-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.start-header h1 {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--primary);
    letter-spacing: -0.04em;
    line-height: 1.15;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.start-header .subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.header-icon {
    font-size: 3rem !important;
    color: var(--primary);
    animation: pulse 2s infinite;
}

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

.subtitle-icon {
    font-size: 1.5rem !important;
    color: var(--primary);
}

.cta-section {
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.btn-large {
    font-size: 1.125rem;
    padding: 1.25rem 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    min-width: 280px;
}

.cta-note {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    line-height: 1.6;
}

.info-icon {
    font-size: 1rem !important;
    color: var(--text-primary);
}

/* ===== Question Screen ===== */
.question-container {
    padding: 4rem 3rem;
    background: var(--bg-primary);
}

.progress-bar {
    width: 100%;
    height: 3px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 3rem;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-sm);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.question-number {
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.question-icon {
    font-size: 1.2rem !important;
    color: var(--primary);
}

.question-content {
    margin-bottom: 3rem;
}

.question-content h3 {
    font-size: clamp(1.375rem, 2.4vw, 1.875rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--primary);
    line-height: 1.4;
    letter-spacing: -0.02em;
}

.question-sub {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 0.5rem;
    letter-spacing: 0;
    line-height: 1.5;
}

.question-type-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-lg);
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 1.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.type-icon {
    font-size: 1.1rem !important;
}

.question-type-single {
    background: var(--bg-tertiary);
    color: var(--primary);
    border: 1px solid var(--border-medium);
}

.question-type-single .type-icon {
    color: var(--primary);
}

.question-type-multiple {
    background: var(--bg-dark);
    color: var(--text-inverse);
    border: 1px solid var(--primary);
}

.question-type-multiple .type-icon {
    color: var(--text-inverse);
}

/* ===== Options ===== */
.options {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.option {
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.option.single-choice {
    border-left: 3px solid var(--accent);
}

.option.single-choice::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.05), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}

.option.single-choice:hover {
    border-color: var(--accent);
    background: var(--bg-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.option.single-choice:hover::before {
    left: 100%;
}

.option.single-choice.selected {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--text-inverse);
    box-shadow: var(--shadow-xl);
    transform: translateY(-3px);
}

.option.multiple-choice {
    border-left: 3px solid var(--primary);
}

.option.multiple-choice::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(15, 23, 42, 0.05), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}

.option.multiple-choice:hover {
    border-color: var(--primary);
    background: var(--bg-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.option.multiple-choice:hover::before {
    left: 100%;
}

.option.multiple-choice.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-xl);
    transform: translateY(-3px);
}

.option.selected::before {
    display: none;
}

.option-label {
    flex: 1;
    pointer-events: none;
}

.option-marker {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-medium);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: var(--bg-primary);
}

.option.single-choice .option-marker {
    border-radius: 50%;
}

.option.multiple-choice .option-marker {
    border-radius: var(--radius-xs);
}

.option.single-choice.selected .option-marker {
    border-color: var(--text-inverse);
    background: var(--accent);
}

.option.single-choice.selected .option-marker::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-inverse);
}

.option.multiple-choice.selected .option-marker {
    border-color: var(--text-inverse);
    background: var(--primary);
}

.option.multiple-choice.selected .option-marker::after {
    content: '✓';
    color: var(--text-inverse);
    font-size: 0.875rem;
    font-weight: 800;
}

/* ===== Navigation ===== */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    gap: 1rem;
}

.navigation.first-question {
    justify-content: flex-end;
}

.btn {
    padding: 1rem 2.25rem;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
    min-width: 160px;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.btn-icon {
    font-size: 1.2rem !important;
    transition: transform 0.3s ease;
    color: inherit;
}

.btn:hover:not(:disabled) .btn-icon {
    transform: scale(1.1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}

.btn:hover:not(:disabled)::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-dark);
}

/* ===== Result Screen ===== */
.result-container {
    padding: 4rem 3rem;
    background: var(--bg-primary);
}

.result-header {
    text-align: center;
    margin-bottom: 3rem;
}

.result-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--primary);
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.result-icon {
    font-size: 3rem !important;
    color: var(--primary);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.score-display {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 1rem;
    letter-spacing: -0.04em;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
}

.score-suffix {
    font-size: 0.4em;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0;
}

.score-icon {
    font-size: 2.75rem !important;
    color: var(--primary);
    animation: sparkle 1.5s infinite;
    align-self: center;
}

@keyframes sparkle {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-5deg) scale(1.1); }
    50% { transform: rotate(5deg) scale(1); }
    75% { transform: rotate(-5deg) scale(1.1); }
}

/* ===== Level Display ===== */
.level-display {
    text-align: center;
    margin-bottom: 3rem;
    padding: 3rem 2.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.level-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.02) 0%, transparent 70%);
    pointer-events: none;
}

.level-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 240px;
    height: 240px;
    margin: 0 auto 1.5rem auto;
    border-radius: var(--radius-2xl);
    background: radial-gradient(circle at 50% 35%, rgba(37, 99, 235, 0.10) 0%, rgba(15, 23, 42, 0.05) 60%, transparent 100%);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    animation: float 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.level-character {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: transparent;
    filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.18));
}

/* レベルごとの背景アクセント */
.level-master .level-badge {
    background: radial-gradient(circle at 50% 35%, rgba(37, 99, 235, 0.18) 0%, rgba(15, 23, 42, 0.08) 60%, transparent 100%);
}

.level-awakened .level-badge {
    background: radial-gradient(circle at 50% 35%, rgba(99, 102, 241, 0.16) 0%, rgba(37, 99, 235, 0.06) 60%, transparent 100%);
}

.level-challenger .level-badge {
    background: radial-gradient(circle at 50% 35%, rgba(100, 116, 139, 0.14) 0%, rgba(71, 85, 105, 0.05) 60%, transparent 100%);
}

.level-novice .level-badge {
    background: radial-gradient(circle at 50% 35%, rgba(148, 163, 184, 0.16) 0%, rgba(203, 213, 225, 0.05) 60%, transparent 100%);
}

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

.level-display h3 {
    font-size: clamp(1.875rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--primary);
    letter-spacing: -0.03em;
    position: relative;
    z-index: 1;
}

.level-display p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 1;
    text-transform: uppercase;
}

/* ===== Advice / Position Sections ===== */
.advice-section,
.position-section {
    margin-bottom: 2rem;
    padding: 2.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--primary);
}

.advice-section {
    border-left: 3px solid var(--accent);
}

.advice-section h3,
.position-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--primary);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-icon {
    font-size: 1.5rem !important;
    color: var(--accent);
}

.position-section .section-icon {
    color: var(--primary);
}

.advice-section p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    font-weight: 400;
}

/* ポジションチャート（坂道） */
.position-chart {
    width: 100%;
    margin-top: 0.5rem;
    overflow: hidden;
}

.position-svg {
    width: 100%;
    height: auto;
    display: block;
    animation: chartFadeIn 0.8s ease-out;
}

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

/* ===== Action Buttons ===== */
.action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .start-screen {
        padding: 1rem;
    }

    .start-header {
        margin-bottom: 2rem;
    }

    .start-header h1 {
        gap: 0.5rem;
    }

    .header-icon {
        font-size: 2rem !important;
    }

    .question-container,
    .result-container {
        padding: 2.5rem 1.5rem;
    }

    .advice-section {
        padding: 1.75rem 1.25rem;
    }

    .position-section {
        padding: 1.5rem 0.75rem;
    }

    .level-display {
        padding: 2rem 1.25rem;
    }

    .level-badge {
        width: 180px;
        height: 180px;
    }

    .navigation {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .navigation .btn {
        width: 100%;
    }

    .action-buttons .btn {
        width: 100%;
    }

    .btn-large {
        min-width: auto;
        width: 100%;
        padding: 1.125rem 2rem;
    }

}

@media (max-width: 480px) {
    .question-container,
    .result-container {
        padding: 2rem 1rem;
    }

    .option {
        padding: 1rem 1.125rem;
        font-size: 0.9375rem;
    }

    .question-content h3 {
        font-size: 1.25rem;
    }
}
