/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Game Area */
#game-area {
    padding: 40px;
    min-height: 500px;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

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

/* Start Screen */
.info-box {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
}

.info-box h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.info-box p {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 15px;
    color: #495057;
}

.visitor-explanation {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    border-left: 4px solid #667eea;
}

.visitor-explanation h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.visitor-explanation p {
    color: #212529;
    font-size: 1em;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: block;
    margin: 0 auto;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Game Screen */
.game-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    flex-wrap: wrap;
    gap: 15px;
}

.level-indicator, .score-indicator, .time-indicator {
    font-size: 1.2em;
    font-weight: bold;
    color: #495057;
}

.level-indicator span, .score-indicator span, .time-indicator span {
    color: #667eea;
    font-size: 1.3em;
}

.message-display {
    margin-bottom: 30px;
}

.message-display h3 {
    color: #495057;
    margin-bottom: 10px;
}

.message-box {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 20px;
    font-size: 1.1em;
    line-height: 1.6;
    color: #212529;
}

.message-box.highlight {
    background: #fff3cd;
    border-color: #ffc107;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
    }
}

/* Organization Chain */
.organization-chain {
    margin: 40px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chain-level {
    opacity: 0.4;
    transition: all 0.3s ease;
}

.chain-level.active {
    opacity: 1;
}

.chain-level.passed {
    opacity: 0.7;
}

.chain-level h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.person-card-form {
    display: block;
}

.person-card {
    background: white;
    border: 3px solid #dee2e6;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: default;
    display: block;
    width: 100%;
}

.person-card.active {
    border-color: #667eea;
    cursor: pointer;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f0ff 100%);
}

.person-card.active:hover {
    transform: translateX(10px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.person-card.passed {
    background: #e7f5e7;
    border-color: #28a745;
}

.person-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.person-card p {
    color: #495057;
    font-size: 1em;
}

.current-message {
    margin-top: 30px;
    padding: 20px;
    background: #fff3cd;
    border-radius: 10px;
    border: 2px solid #ffc107;
}

.current-message h4 {
    color: #856404;
    margin-bottom: 10px;
}

/* Result Screen */
#result-screen h2 {
    color: #667eea;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2em;
}

/* Win/Lose Banners */
.win-banner {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.3);
    animation: slideDown 0.5s ease-out;
}

.lose-banner {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(220, 53, 69, 0.3);
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.win-banner h2,
.lose-banner h2 {
    color: white;
    font-size: 2.2em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.win-message,
.lose-message {
    font-size: 1.3em;
    font-weight: bold;
    margin: 0;
}

.delivery-subtitle {
    color: #495057;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.result-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.result-box h3 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.result-stats {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 1.1em;
    color: #495057;
}

.stat-value {
    font-size: 1.3em;
    font-weight: bold;
    color: #667eea;
}

.result-feedback {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    border-left: 4px solid #667eea;
}

.result-feedback p {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 15px;
    color: #495057;
}

.feedback-good {
    color: #28a745 !important;
    font-weight: bold;
}

.feedback-medium {
    color: #ffc107 !important;
    font-weight: bold;
}

.feedback-poor {
    color: #dc3545 !important;
    font-weight: bold;
}

/* Footer */
footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #6c757d;
    border-top: 1px solid #dee2e6;
}

footer p {
    margin: 5px 0;
}

.theme {
    font-style: italic;
    font-size: 0.9em;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 1em;
    }

    #game-area {
        padding: 20px;
    }

    .result-comparison {
        grid-template-columns: 1fr;
    }

    .game-header {
        flex-direction: column;
        gap: 10px;
    }

    .person-icon {
        font-size: 2.5em;
    }
}

/* Print Styles for Offline Display */
@media print {
    body {
        background: white;
    }

    .container {
        box-shadow: none;
    }

    .btn-primary {
        display: none;
    }
}

/* Communication Choice Buttons */
.communication-choices {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.choice-form {
    flex: 1;
    min-width: 150px;
}

.choice-button {
    width: 100%;
    padding: 15px;
    border: 3px solid #dee2e6;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.choice-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.email-choice {
    border-color: #28a745;
}

.email-choice:hover {
    background: #d4edda;
    border-color: #1e7e34;
}

.phone-choice {
    border-color: #ffc107;
}

.phone-choice:hover {
    background: #fff3cd;
    border-color: #d39e00;
}

.verbal-choice {
    border-color: #dc3545;
}

.verbal-choice:hover {
    background: #f8d7da;
    border-color: #bd2130;
}

.choice-icon {
    font-size: 2em;
}

.choice-name {
    font-weight: bold;
    font-size: 1.1em;
    color: #212529;
}

.choice-stats {
    font-size: 0.9em;
    color: #6c757d;
}

.choice-prompt {
    font-weight: bold;
    color: #667eea;
    margin: 10px 0;
}

.active-choice {
    border: 3px solid #667eea;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f0ff 100%);
    padding: 20px;
}

/* Partial Win Banner */
.partial-win-banner {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(255, 193, 7, 0.3);
    animation: slideDown 0.5s ease-out;
}

.partial-win-banner h2 {
    color: white;
    font-size: 2.2em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.partial-message,
.win-detail,
.lose-detail,
.partial-detail {
    font-size: 1.1em;
    margin: 5px 0;
}

/* Strategy Review */
.strategy-review {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.strategy-review h4 {
    color: #495057;
    margin-bottom: 15px;
}

.choices-made {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.choice-badge {
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
}

.choice-badge.email {
    background: #d4edda;
    color: #155724;
    border: 2px solid #28a745;
}

.choice-badge.phone {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffc107;
}

.choice-badge.verbal {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #dc3545;
}

/* Responsive Updates */
@media (max-width: 768px) {
    .communication-choices {
        flex-direction: column;
    }

    .choice-form {
        width: 100%;
    }

    .game-header {
        flex-direction: column;
        gap: 10px;
    }
}
