/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #e8f5ff 0%, #f0f9ff 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Color variables */
:root {
    --primary-color: #64B9FA;
    --accent-color: #FA7525;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --white: #ffffff;
    --shadow-light: 0 4px 15px rgba(100, 185, 250, 0.2);
    --shadow-medium: 0 8px 25px rgba(100, 185, 250, 0.3);
    --border-radius: 15px;
    --border-radius-small: 8px;
}

/* Container */
.container {
    max-width: 420px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Screen transitions */
.screen {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.screen.active {
    display: block;
}

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

/* Welcome Screen */
.hero-section {
    text-align: center;
    padding: 40px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.title-area {
    margin-bottom: 30px;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.title-line1, .title-line2 {
    display: block;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    font-weight: 400;
}

.main-illustration {
    margin: 30px 0;
    padding: 20px;
}

.illustration-placeholder {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 40px 20px;
    box-shadow: var(--shadow-light);
    text-align: center;
    color: var(--text-light);
}

.main-illustration-image {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 10px;
    box-shadow: var(--shadow-light);
    overflow: hidden;
}

.main-illustration-image img {
    width: 100%;
    height: auto;
    border-radius: calc(var(--border-radius) - 5px);
    display: block;
}

.result-mushroom-image {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: var(--shadow-medium);
    border: 4px solid var(--white);
}

.intro-text {
    margin: 30px 0;
    padding: 0 10px;
}

.intro-text p {
    margin-bottom: 10px;
    font-size: 1rem;
    color: var(--text-dark);
}

/* Buttons */
.cta-button {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    padding: 18px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin: 20px 0;
    min-height: 56px;
    justify-content: center;
}

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

.cta-button.pulse {
    animation: pulse 2s infinite;
}

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

.feature-points {
    display: flex;
    justify-content: space-around;
    margin-top: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.point {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.point i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* Quiz Screen */
.quiz-header {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(100, 185, 250, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.question-counter {
    text-align: center;
    color: var(--text-light);
    font-weight: 600;
}

.quiz-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.question-area {
    margin-bottom: 30px;
}

.question-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;
    text-align: center;
    padding: 0 10px;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.option-button {
    background: var(--white);
    border: 2px solid rgba(100, 185, 250, 0.3);
    border-radius: var(--border-radius);
    padding: 20px;
    font-size: 1rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    line-height: 1.5;
    min-height: 70px;
    display: flex;
    align-items: center;
}

.option-button:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-light);
    transform: translateY(-2px);
}

.option-button.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(100, 185, 250, 0.1), rgba(250, 117, 37, 0.1));
    box-shadow: var(--shadow-medium);
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: auto;
}

.nav-button {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
}

.nav-button.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--white);
}

.nav-button.secondary {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

/* Result Screen */
.result-header {
    text-align: center;
    margin-bottom: 30px;
}

.result-title {
    font-size: 1.5rem;
    color: var(--text-dark);
    font-weight: 700;
}

.result-content {
    text-align: center;
    margin-bottom: 40px;
}

.result-illustration {
    margin-bottom: 30px;
}

.result-info {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 30px 20px;
    box-shadow: var(--shadow-light);
    margin-bottom: 30px;
}

.result-type {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 15px;
    line-height: 1.2;
}

.result-catchphrase {
    font-size: 1.1rem;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 20px;
    font-style: italic;
}

.result-description {
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 1rem;
}

.result-actions {
    margin-bottom: 30px;
}

.share-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
}

.share-button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius-small);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--white);
    min-height: 48px;
}

.share-button.twitter {
    background: #1DA1F2;
}

.share-button.line {
    background: #00B900;
}

.share-button:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.retry-button {
    background: var(--white);
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 50px;
}

.retry-button:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, rgba(100, 185, 250, 0.1), rgba(250, 117, 37, 0.1));
    border-radius: var(--border-radius);
    padding: 30px 20px;
    margin: 30px 0;
    border: 2px solid rgba(100, 185, 250, 0.3);
}

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

.cta-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 15px;
    line-height: 1.3;
}

.cta-description {
    color: var(--text-dark);
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Loading Screen */
.loading-content {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.loading-spinner {
    margin-bottom: 30px;
}

.rotating {
    animation: rotate 2s linear infinite;
    font-size: 4rem;
    color: var(--primary-color);
}

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

.loading-text {
    font-size: 1.2rem;
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 20px;
}

.loading-dots {
    display: flex;
    gap: 8px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { 
        transform: scale(0);
    } 40% { 
        transform: scale(1);
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Mobile optimization */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .main-title {
        font-size: 2.2rem;
    }
    
    .question-text {
        font-size: 1.2rem;
    }
    
    .result-type {
        font-size: 1.7rem;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .quiz-navigation {
        flex-direction: column;
    }
    
    .nav-button {
        width: 100%;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .cta-button.pulse {
        animation: none;
    }
    
    .rotating {
        animation: none;
    }
    
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0066cc;
        --accent-color: #cc3300;
        --text-dark: #000000;
        --text-light: #333333;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
        color: #e2e8f0;
    }
    
    :root {
        --text-dark: #e2e8f0;
        --text-light: #a0aec0;
        --white: #2d3748;
    }
    
    .illustration-placeholder {
        background: #4a5568;
        color: #a0aec0;
    }
    
    .option-button {
        background: #4a5568;
        border-color: rgba(100, 185, 250, 0.5);
        color: #e2e8f0;
    }
    
    .result-info {
        background: #4a5568;
    }
    
    .retry-button {
        background: #4a5568;
        color: var(--primary-color);
    }
}