* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #333;
}

.container {
    width: 100%;
    max-width: 800px;
}

.screen {
    display: none;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Welcome Screen */
.welcome-content {
    text-align: center;
}

.welcome-logo {
    height: 72px;
    width: auto;
    display: block;
    margin: 0 auto 12px;
    object-fit: contain;
}

/* Results */
.results-logo {
    height: 64px;
    width: auto;
    display: block;
    margin: 0 auto 12px;
    object-fit: contain;
}

.results-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.5s ease;
}

.welcome-content h2 {
    font-size: 1.8em;
    color: #333;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 30px;
}

.instructions {
    text-align: left;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.instructions h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.instructions ul {
    list-style: none;
    padding-left: 0;
}

.instructions li {
    padding: 10px 0;
    padding-left: 30px;
    position: relative;
    color: #555;
    line-height: 1.6;
}

.instructions li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
    font-size: 1.2em;
}

.btn {
    padding: 15px 40px;
    font-size: 1.1em;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    margin-bottom: 15px;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(245, 87, 108, 0.4);
}

.disclaimer {
    margin-top: 20px;
    color: #999;
    font-size: 0.9em;
}

/* Question Screen */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    width: 0%;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#question-number {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-hint {
    padding: 8px 16px;
    font-size: 0.9em;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-hint:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.difficulty-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    background: #e8eaf6;
    color: #667eea;
}

.prompt {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
}

.grid-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #fafafa;
    border-radius: 12px;
}

#pattern-grid {
    max-width: 450px;
    width: 100%;
    height: auto;
}

.options-container {
    margin-top: 20px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.option-card {
    background: white;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.option-card:hover {
    border-color: #667eea;
    border-width: 3px;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.option-card.selected {
    border-color: #667eea;
    border-width: 3px;
    background: #e8eaf6;
}

.option-label {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
}

.option-svg {
    width: 100%;
    height: 120px;
}

/* Results Screen */
.results-content {
    text-align: center;
}

.results-content h1 {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 30px;
}

.score-display {
    margin-bottom: 40px;
}

.score-circle {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

#score-percentage {
    font-size: 3em;
    font-weight: bold;
    color: white;
}

#score-text {
    font-size: 1.5em;
    color: #333;
}

.score-breakdown {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px 30px;
    background: #f8f9fa;
    border-radius: 12px;
    flex-wrap: wrap;
}

.breakdown-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.breakdown-label {
    font-size: 0.95em;
    color: #666;
    font-weight: 500;
}

.breakdown-value {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
}

.performance-message {
    font-size: 1.2em;
    color: #555;
    margin-bottom: 30px;
    padding: 20px;
    background: #e8f5e9;
    border-radius: 10px;
    line-height: 1.6;
    white-space: pre-line;
}

.bonus-unlock {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    text-align: center;
    border: 3px solid #f39c12;
}

.bonus-unlock h3 {
    color: #d35400;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.bonus-unlock p {
    color: #333;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    z-index: 1001;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5em;
    color: #667eea;
}

.btn-close {
    background: none;
    border: none;
    font-size: 2em;
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.btn-close:hover {
    background: #f0f0f0;
    color: #333;
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.modal-body p {
    margin: 0;
    font-size: 1.1em;
    line-height: 1.8;
    color: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
    .screen {
        padding: 25px;
    }

    .welcome-logo {
        height: 56px;
    }

    .results-logo {
        height: 52px;
    }

    .results-content {
        padding: 25px;
    }

    .welcome-content h2 {
        font-size: 1.3em;
    }

    /* Keep 2 columns for options on mobile */
    .options-grid {
        gap: 10px;
    }

    .option-card {
        padding: 15px;
    }

    .score-breakdown {
        gap: 20px;
        padding: 15px 20px;
    }
    
    .breakdown-item {
        gap: 6px;
    }
    
    .breakdown-label {
        font-size: 0.85em;
    }
    
    .breakdown-value {
        font-size: 1.6em;
    }

    .score-circle {
        width: 150px;
        height: 150px;
    }

    #score-percentage {
        font-size: 2.5em;
    }
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 20px;
    padding: 20px 0;
    width: 100%;
    max-width: 800px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.footer-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.footer-link {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.85;
    transition: all 0.3s ease;
    font-weight: 500;
}

.footer-link:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.footer-divider {
    color: white;
    opacity: 0.5;
}

.footer-copyright {
    color: white;
    opacity: 0.7;
    font-size: 0.8rem;
    margin-top: 5px;
}

@media (max-width: 768px) {
    .footer {
        margin-top: 20px;
        padding: 15px 0;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .footer-divider {
        display: none;
    }
}

