* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 28px;
    font-weight: 600;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.progress-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 20px;
}

.progress-label {
    font-size: 16px;
}

#progressText {
    font-size: 18px;
    font-weight: 600;
}

.lives-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lives-label {
    font-size: 16px;
}

.lives-display {
    display: flex;
    gap: 6px;
}

.life-icon {
    width: 24px;
    height: 24px;
    background: #ff4757;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.life-icon.lost {
    background: #555;
    opacity: 0.3;
}

.main-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    min-height: 600px;
}

/* Progress Pane */
.progress-pane {
    background: #f8f9fa;
    padding: 30px;
    border-right: 2px solid #e9ecef;
    overflow-y: auto;
    max-height: calc(100vh - 160px);
}

.progress-pane h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 22px;
}

.empty-state {
    color: #6c757d;
    font-style: italic;
    line-height: 1.6;
}

.progress-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.progress-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: default;
    transition: all 0.2s;
}

.progress-item.clickable {
    cursor: pointer;
}

.progress-item.clickable:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.progress-item.green-choice {
    border-left-color: #2ecc71;
    background: #d5f4e6;
}

.progress-item.yellow-choice {
    border-left-color: #f39c12;
    background: #fef5e7;
}

.progress-item.red-choice {
    border-left-color: #e74c3c;
    background: #fadbd8;
}

.progress-item-header {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 8px;
    font-size: 14px;
}

.progress-item-text {
    color: #495057;
    font-size: 14px;
    line-height: 1.4;
}

/* Question Pane */
.question-pane {
    padding: 40px;
    overflow-y: auto;
    max-height: calc(100vh - 160px);
}

.hidden {
    display: none !important;
}

/* Welcome Screen */
.welcome-screen {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 0;
}

.welcome-screen h2 {
    color: #667eea;
    font-size: 36px;
    margin-bottom: 20px;
}

.intro-text {
    font-size: 18px;
    color: #495057;
    margin-bottom: 30px;
    line-height: 1.6;
}

.instructions {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: left;
}

.instructions h3 {
    color: #333;
    margin-bottom: 15px;
}

.instructions ul {
    list-style: none;
    margin-bottom: 10px;
}

.instructions li {
    padding: 10px 0;
    font-size: 16px;
    line-height: 1.6;
}

.color-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    margin: 0 4px;
}

.color-indicator.green {
    background: #2ecc71;
}

.color-indicator.yellow {
    background: #f39c12;
}

.color-indicator.red {
    background: #e74c3c;
}

.start-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* Question Screen */
.step-header {
    margin-bottom: 25px;
}

.step-number {
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.step-name {
    color: #333;
    font-size: 28px;
    margin-top: 8px;
}

.context-box {
    background: #e3f2fd;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid #2196f3;
}

.context-box p {
    color: #1565c0;
    line-height: 1.6;
}

.question-box {
    margin-bottom: 30px;
}

.question-box h3 {
    color: #333;
    font-size: 20px;
    line-height: 1.5;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option-button {
    background: white;
    border: 2px solid #dee2e6;
    padding: 20px;
    border-radius: 8px;
    text-align: left;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.option-button:hover {
    border-color: #667eea;
    background: #f8f9fa;
    transform: translateX(5px);
}

.option-letter {
    background: #667eea;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.option-text {
    flex: 1;
    color: #333;
    line-height: 1.5;
}

/* Results Screen */
.results-screen {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 0;
}

.results-screen h2 {
    color: #667eea;
    font-size: 36px;
    margin-bottom: 20px;
}

.life-lost-message {
    background: #fadbd8;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    padding: 15px 25px;
    margin-bottom: 25px;
}

.life-lost-message p {
    color: #c0392b;
    font-weight: 600;
    font-size: 16px;
}

.perfect-run-message {
    background: #d5f4e6;
    border: 2px solid #2ecc71;
    border-radius: 8px;
    padding: 15px 25px;
    margin-bottom: 25px;
}

.perfect-run-message p {
    color: #27ae60;
    font-weight: 600;
    font-size: 16px;
}

.game-over-screen {
    text-align: center;
    max-width: 600px;
    margin: 60px auto;
}

.game-over-screen h2 {
    color: #e74c3c;
    font-size: 42px;
    margin-bottom: 20px;
}

.game-over-message {
    font-size: 18px;
    color: #495057;
    margin-bottom: 20px;
    line-height: 1.6;
}

.encouragement {
    font-size: 16px;
    color: #6c757d;
    margin-bottom: 30px;
    font-style: italic;
}

.score-summary {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.score-item {
    padding: 25px 35px;
    border-radius: 12px;
    text-align: center;
    min-width: 120px;
}

.score-item.optimal {
    background: #d5f4e6;
    border: 2px solid #2ecc71;
}

.score-item.acceptable {
    background: #fef5e7;
    border: 2px solid #f39c12;
}

.score-item.incorrect {
    background: #fadbd8;
    border: 2px solid #e74c3c;
}

.score-count {
    display: block;
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 8px;
}

.score-item.optimal .score-count {
    color: #27ae60;
}

.score-item.acceptable .score-count {
    color: #e67e22;
}

.score-item.incorrect .score-count {
    color: #c0392b;
}

.score-label {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
}

.hint-box {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    text-align: left;
}

.hint-box h3 {
    color: #856404;
    margin-bottom: 15px;
    font-size: 18px;
}

.hint-step {
    color: #856404;
    font-weight: 600;
    margin-bottom: 10px;
}

.hint-text {
    color: #856404;
    line-height: 1.6;
}

.results-instruction {
    color: #6c757d;
    font-size: 16px;
    margin-bottom: 25px;
    font-style: italic;
}

.pathway-result {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.pathway-result p {
    font-size: 18px;
    color: #495057;
}

.pathway-result strong {
    color: #667eea;
}

.restart-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.restart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 35px;
    max-width: 550px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #aaa;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #333;
}

.modal-step-name {
    color: #667eea;
    font-size: 22px;
    margin-bottom: 15px;
    padding-right: 30px;
}

.modal-question {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
    font-style: italic;
}

.modal-choice {
    margin-bottom: 20px;
}

.modal-label {
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 8px;
}

.modal-choice-text {
    display: block;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.4;
}

.modal-choice-text.green {
    background: #d5f4e6;
    border-left: 4px solid #2ecc71;
    color: #27ae60;
}

.modal-choice-text.yellow {
    background: #fef5e7;
    border-left: 4px solid #f39c12;
    color: #e67e22;
}

.modal-choice-text.red {
    background: #fadbd8;
    border-left: 4px solid #e74c3c;
    color: #c0392b;
}

.modal-feedback {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.modal-feedback p {
    color: #495057;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .progress-pane {
        border-right: none;
        border-bottom: 2px solid #e9ecef;
        max-height: 250px;
    }

    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    header h1 {
        font-size: 22px;
    }

    .score-summary {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .score-item {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 600px) {
    .question-pane {
        padding: 20px;
    }

    .step-name {
        font-size: 24px;
    }

    .option-button {
        padding: 15px;
    }

    .instructions {
        padding: 20px;
    }

    .modal-content {
        padding: 25px;
    }
}
