:root {
    --main-color: #2C3E50;
    --accent-color: #2D8B92;
    --main-accent-gradient: linear-gradient(135deg, #2C3E50 0%, #2D8B92 100%);
    --text-color: #4A4A4A;
    --base-color: #FFFFFF;
    --light-bg: #F8F9FA;
    --border-color: #E6E9EC;
    --card-shadow: 0 10px 40px rgba(44, 62, 80, 0.08);
    --hover-shadow: 0 20px 60px rgba(44, 62, 80, 0.12);
}

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

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    color: var(--text-color);
    background-color: var(--base-color);
    line-height: 1.6;
    overflow-x: hidden;
}

#app {
    width: 100%;
}

.screen {
    display: none;
    min-height: 100vh;
    animation: fadeIn 0.6s ease-out forwards;
}

.screen.active {
    display: block;
}

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

/* --- Common Components --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
}

.primary-btn {
    display: inline-block;
    background: var(--main-accent-gradient);
    color: white;
    padding: 18px 48px;
    font-size: 1.15rem;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(45, 139, 146, 0.25);
    position: relative;
    overflow: hidden;
}

.primary-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s;
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(45, 139, 146, 0.35);
}

.primary-btn:hover::after {
    opacity: 1;
}

/* --- Top Screen (Unique Professional Design) --- */
#top-screen {
    background: #fdfdfd;
}

.hero-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 80vh;
    position: relative;
}

.hero-content {
    flex: 1;
    max-width: 550px;
    z-index: 2;
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Abstract Background Pattern */
.bg-pattern {
    position: absolute;
    top: -10%;
    right: -10%;
    width: 60%;
    height: 120%;
    background: var(--main-accent-gradient);
    border-radius: 40px;
    opacity: 0.03;
    transform: rotate(5deg);
    z-index: 1;
}

.logo-top {
    margin-bottom: 60px;
}

.win-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
}

h1.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.15;
    color: var(--main-color);
    margin-bottom: 24px;
}

h1.hero-title .accent-text {
    color: var(--accent-color);
    display: block;
}

.hero-subtext {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 40px;
    border-left: 3px solid var(--accent-color);
    padding-left: 20px;
}

/* Visual Level Indicators */
.level-cards-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.level-card-mini {
    background: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    width: 280px;
    transition: transform 0.4s;
    border-left: 4px solid var(--accent-color);
}

.char-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.level-desc {
    display: flex;
    flex-direction: column;
}

.level-card-mini:nth-child(2) { transform: translateX(20px); border-color: rgba(45, 139, 146, 0.8); }
.level-card-mini:nth-child(3) { transform: translateX(40px); border-color: rgba(45, 139, 146, 0.6); }
.level-card-mini:nth-child(4) { transform: translateX(60px); border-color: rgba(45, 139, 146, 0.4); }
.level-card-mini:nth-child(5) { transform: translateX(80px); border-color: rgba(45, 139, 146, 0.2); }

.level-num {
    font-weight: 900;
    color: var(--main-color);
    font-size: 1.2rem;
}

.level-label {
    font-weight: 700;
    font-size: 0.95rem;
}

/* Info Summary Section */
.top-info-footer {
    display: flex;
    gap: 40px;
    margin-top: 60px;
}

.footer-item h4 {
    font-size: 0.85rem;
    color: #88929b;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.footer-item p {
    font-weight: 700;
    color: var(--main-color);
}

/* --- Quiz Screen --- */
#quiz-screen {
    background: #fdfdfd;
}

.quiz-header-bar {
    background: var(--main-color);
    color: white;
    padding: 20px 0;
}

.quiz-header-bar .container {
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-badge {
    background: var(--accent-color);
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.q-progress-wrap {
    background: white;
    padding: 60px 40px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    margin-top: -30px;
}

.progress-track {
    height: 6px;
    background: #eff2f5;
    border-radius: 3px;
    margin-bottom: 40px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--main-accent-gradient);
    width: 0%;
    transition: width 0.4s ease;
}

.question-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--main-color);
    margin-bottom: 48px;
    line-height: 1.4;
    min-height: 120px; /* Fix vertical position of choice A */
}

.choices-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.choice-option {
    background: white;
    border: 1px solid #e1e4e8;
    padding: 24px 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
}

@media (hover: hover) {
    .choice-option:hover {
        border-color: var(--accent-color);
        background: #fcfdfe;
        transform: translateX(5px);
    }
    .choice-option:hover .choice-indicator {
        background: var(--accent-color);
        color: white;
    }
}

.choice-option:active {
    border-color: var(--accent-color);
    background: #fcfdfe;
    transform: translateX(2px);
}

.choice-option.selected {
    border-color: var(--accent-color);
    background: #eef2ff;
    transform: scale(0.98);
}

.choice-option.selected .choice-indicator {
    background: var(--accent-color);
    color: white;
}

.choice-indicator {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: #f0f2f5;
    color: var(--main-color);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    margin-right: 24px;
    font-weight: 800;
}

.choice-option:active .choice-indicator {
    background: var(--accent-color);
    color: white;
}

/* --- Modern Form (Referencing 入力フォーム.png) --- */
.modern-form {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.form-group-modern {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.flex-label {
    display: flex;
    align-items: center;
}

.main-label {
    border-left: 4px solid var(--accent-color);
    padding-left: 10px;
    font-weight: 700;
    color: var(--main-color);
    font-size: 1.1rem;
}

.required-badge {
    background: #FF5A5F; /* Modern red/pink */
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 2px;
    margin-left: 12px;
}

.sub-label {
    display: block;
    font-size: 0.85rem;
    color: #4A4A4A;
    margin-bottom: 6px;
}

.input-row {
    display: flex;
    gap: 20px;
}

.input-col {
    flex: 1;
}

.modern-form input, 
.modern-form select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modern-form input::placeholder {
    color: #9CA3AF;
}

.modern-form input:focus, 
.modern-form select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(45, 139, 146, 0.1);
}

.agreement-section {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
    white-space: nowrap;
}

.policy-link {
    color: var(--accent-color);
    text-decoration: underline;
    margin-right: 4px;
}

.policy-link:hover {
    opacity: 0.8;
}

.submit-wrap {
    margin-top: 40px; /* Increased spacing */
}

.modern-submit {
    width: 100%;
    border-radius: 8px;
    padding: 20px;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

/* --- Result Screen --- */
.result-header-card {
    background: var(--main-accent-gradient);
    color: white;
    border-radius: 24px;
    padding: 60px;
    text-align: center;
    margin-bottom: 40px;
    box-shadow: 0 20px 50px rgba(44, 62, 80, 0.15);
}

.result-name-label {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 12px;
}

.rank-icon-wrap {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.char-icon-large {
    width: 150px;
    height: 150px;
    object-fit: contain;
}

.result-rank-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 24px;
}

.result-main-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 32px;
    margin-bottom: 60px;
}

.score-box {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    text-align: center;
    border-top: 4px solid var(--accent-color);
}

.score-num {
    font-size: 4rem;
    font-weight: 900;
    color: var(--main-color);
}

.score-total {
    font-size: 1.2rem;
    color: #88929b;
}

.feedback-box {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    font-size: 1.15rem;
    line-height: 1.8;
}

.category-analysis {
    background: white;
    padding: 48px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    margin-bottom: 40px;
}

.category-bar-row {
    margin-bottom: 24px;
}

.category-label-wrap {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 700;
}

.bar-bg {
    height: 8px;
    background: #f0f2f5;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    transition: width 1s ease-out;
}

.pro-analysis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 40px;
}

.analysis-card {
    padding: 32px;
    border-radius: 12px;
}

.analysis-card.good { background: #f1f9f9; border-left: 4px solid var(--accent-color); }
.analysis-card.needs-work { background: #fef8f8; border-left: 4px solid #e53e3e; }

.analysis-card h4 {
    color: var(--main-color);
    margin-bottom: 16px;
    font-weight: 800;
}

.analysis-card ul {
    list-style: none;
}

.analysis-card li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
    font-weight: 600;
}

.analysis-card li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

.result-share-area {
    margin: 40px 0;
    display: flex;
    justify-content: center;
}

.sns-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.share-btn-x, .share-btn-fb, .share-btn-in, .copy-btn {
    border: none;
    padding: 16px 20px;
    border-radius: 4px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
    font-size: 0.9rem;
    white-space: nowrap;
}

.share-btn-x { background: #000; }
.share-btn-fb { background: #1877F2; }
.share-btn-in { background: #0077B5; }
.copy-btn { background: #4B5563; }

/* Explanations List */
.explanation-list {
    margin-top: 60px;
}

.exp-item {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 24px 0;
}

.exp-head {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}

.exp-tag {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.exp-tag.correct { background: #e6f6f4; color: var(--accent-color); }
.exp-tag.wrong { background: #fbe9e9; color: #e53e3e; }

.exp-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0;
}

.exp-item.open .exp-body {
    max-height: 500px;
    margin-top: 20px;
}

.link-btn-official {
    background: white;
    border: 2px solid var(--main-color);
    color: var(--main-color);
    padding: 16px 40px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 700;
    display: inline-block;
}

.cta-wrap {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 60px;
}

.retry-btn {
    background: #E5E7EB;
    color: var(--main-color);
    border: none;
    padding: 16px 40px;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.retry-btn:hover {
    background: #D1D5DB;
}

/* Responsive Adjustments */
@media (max-width: 900px) {
    .container { padding: 20px 15px; }
    
    .hero-wrap { 
        flex-direction: column !important; 
        min-height: auto;
        text-align: center;
    }
    
    .hero-content { 
        order: 1; 
        max-width: none;
        margin-bottom: 40px;
    }

    .hero-visual { 
        order: 2; 
        margin-top: 20px;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .bg-pattern { display: none; }
    
    .hero-title { font-size: 2.2rem !important; }
    .hero-subtext { font-size: 1rem; margin-bottom: 30px; border-left: none; padding-left: 0; }
    
    .level-card-mini { 
        padding: 12px 20px; 
        width: 100%;
        max-width: 300px; 
        font-size: 0.9rem;
        transform: none !important; /* Reset translateX */
        margin: 0 auto;
    }
    
    .top-info-footer { 
        margin-top: 40px; 
        margin-bottom: 0; 
        justify-content: center;
        gap: 30px;
    }
    
    .logo-top { margin-bottom: 40px; text-align: center; }
    .win-logo { height: 40px; }

    /* Quiz Screen Optimization */
    #quiz-screen .container { padding-top: 10px; padding-bottom: 10px; }
    .q-progress-wrap { padding: 24px 20px; margin-top: -10px; }
    .progress-track { margin-bottom: 20px; }
    
    .question-text { 
        font-size: 1.15rem; 
        margin-bottom: 24px; 
        line-height: 1.4;
        min-height: 80px; 
    }
    
    .choices-grid { gap: 10px; }
    .choice-option { padding: 14px 18px; font-size: 0.9rem; }
    .choice-indicator { width: 30px; height: 30px; margin-right: 12px; font-size: 0.8rem; }

    /* Lead Form Fixes */
    .custom-checkbox {
        white-space: normal; 
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .agreement-text {
        display: block;
        margin-top: 8px;
    }

    /* Result Screen Fixes */
    .result-main-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    .feedback-box {
        padding: 24px;
        font-size: 1rem;
    }
    
    .pro-analysis {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .exp-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .exp-tag {
        width: fit-content;
        white-space: nowrap;
    }

    /* Rest of existing mobile styles */
    .result-rank-title { font-size: 2rem; }
    .result-header-card { padding: 40px 20px; }
    .score-num { font-size: 2.5rem; }
    .score-box { padding: 20px; }
    .category-analysis { padding: 24px; }
    
    .cta-wrap { flex-direction: column; align-items: stretch; margin-top: 30px; }
    .sns-buttons { flex-direction: column; }
    .share-btn-x, .share-btn-fb, .share-btn-in, .copy-btn, .link-btn-official, .retry-btn { width: 100%; text-align: center; }
}

@media (max-height: 700px) and (max-width: 600px) {
    /* Highly constrained vertical space */
    .question-text { font-size: 1rem; margin-bottom: 15px; }
    .choice-option { padding: 10px 15px; }
    .q-progress-wrap { padding: 15px; }
}
