/* Maple Path - Canadian Journey Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background: linear-gradient(180deg, #87CEEB 0%, #E0F4FF 100%);
}

/* Top UI Bar */
.ui-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.ui-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.ui-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ui-value {
    font-size: 20px;
    font-weight: bold;
    color: #C41E3A;
}

.streak-item .ui-value {
    color: #FF6B00;
}

.level-indicator {
    min-width: 90px;
}

.level-badge {
    font-size: 14px !important;
    padding: 4px 12px;
    border-radius: 15px;
    background: #28A745;
    color: white !important;
}

.progress-container {
    flex: 1;
    max-width: 200px;
    margin: 0 15px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #E8E8E8;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 4px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #C41E3A, #FF6B6B);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

.question-counter .ui-value {
    font-size: 16px;
    color: #333;
}

.pause-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background 0.2s;
}

.pause-btn:hover {
    background: rgba(0,0,0,0.1);
}

/* Pause Menu */
.pause-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 500;
}

.pause-menu.active {
    display: flex;
}

.pause-content {
    background: white;
    border-radius: 20px;
    padding: 35px;
    text-align: center;
    max-width: 350px;
    width: 90%;
}

.pause-content h2 {
    margin-bottom: 10px;
    color: #333;
}

.pause-content p {
    color: #666;
    margin-bottom: 20px;
}

.pause-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
    font-size: 16px;
    color: #333;
}

.pause-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pause-btn-resume, .pause-btn-exit {
    padding: 14px 25px;
    font-size: 16px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}

.pause-btn-resume {
    background: linear-gradient(135deg, #28A745, #20C997);
    color: white;
}

.pause-btn-exit {
    background: #E8E8E8;
    color: #333;
}

.pause-btn-resume:hover, .pause-btn-exit:hover {
    transform: scale(1.03);
}

/* Game Canvas */
.game-scene {
    position: relative;
    width: 100%;
    height: calc(100vh - 60px);
    overflow: hidden;
}

.game-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}

#gameCanvas {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    background: transparent;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 25px 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalIn 0.3s ease;
    position: relative;
    cursor: move;
    user-select: none;
}

.modal.dragging {
    opacity: 0.9;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
}

.modal-pause-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 8px;
    opacity: 0.6;
    transition: all 0.2s;
}

.modal-pause-btn:hover {
    opacity: 1;
    background: rgba(0,0,0,0.1);
}

/* Make buttons and inputs not draggable */
.modal button, .modal input, .modal .option-btn {
    cursor: pointer;
}

@keyframes modalIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.checkpoint-badge {
    background: linear-gradient(135deg, #C41E3A, #FF6B6B);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
}

.question-type-badge {
    background: #E8E8E8;
    color: #666;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
}

.lesson-badge {
    background: #4A90D9;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}

.audio-section {
    margin-bottom: 15px;
}

.audio-play-btn {
    padding: 12px 30px;
    font-size: 16px;
    background: linear-gradient(135deg, #4A90D9, #357ABD);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.2s;
}

.audio-play-btn:hover {
    transform: scale(1.05);
}

.audio-play-btn:active {
    transform: scale(0.98);
}

.question-text {
    font-size: 18px;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.4;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    padding: 14px 20px;
    font-size: 15px;
    border: 2px solid #E8E8E8;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-btn:hover {
    border-color: #C41E3A;
    background: #FFF5F5;
}

.option-btn.correct {
    border-color: #28A745;
    background: #D4EDDA;
    color: #155724;
}

.option-btn.incorrect {
    border-color: #DC3545;
    background: #F8D7DA;
    color: #721C24;
}

.option-btn:disabled {
    cursor: not-allowed;
}

.feedback {
    margin-top: 15px;
    font-size: 16px;
    font-weight: bold;
    min-height: 25px;
}

.feedback.correct { color: #28A745; }
.feedback.incorrect { color: #DC3545; }


/* Checkpoint Screen */
.checkpoint-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #28A745 0%, #20C997 100%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 250;
}

.checkpoint-screen.active {
    display: flex;
}

.checkpoint-content {
    text-align: center;
    color: white;
    animation: fadeIn 0.5s ease;
}

.checkpoint-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.checkpoint-content h2 {
    font-size: 36px;
    margin-bottom: 5px;
}

.checkpoint-subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 25px;
}

.checkpoint-stats {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-bottom: 20px;
}

.cp-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cp-stat-value {
    font-size: 36px;
    font-weight: bold;
}

.cp-stat-label {
    font-size: 12px;
    opacity: 0.8;
    text-transform: uppercase;
}

.checkpoint-segment {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 25px;
    padding: 8px 20px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    display: inline-block;
}

.checkpoint-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.cp-btn {
    padding: 14px 30px;
    font-size: 16px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}

.cp-btn:hover {
    transform: scale(1.05);
}

.cp-continue {
    background: white;
    color: #28A745;
}

.cp-exit {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
}

/* Guest Modal */
.guest-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 260;
}

.guest-modal.active {
    display: flex;
}

.guest-content {
    background: white;
    border-radius: 20px;
    padding: 35px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: modalIn 0.3s ease;
}

.guest-icon {
    font-size: 50px;
    margin-bottom: 15px;
}

.guest-content h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 20px;
}

.guest-brand {
    color: #2563EB;
    font-size: 32px;
    font-weight: bold;
    margin: 0 0 5px 0;
}

.guest-content p {
    color: #666;
    margin-bottom: 10px;
}

.guest-progress {
    background: #FFF3CD;
    color: #856404;
    padding: 10px;
    border-radius: 10px;
    font-size: 14px;
    margin: 15px 0 10px 0;
}

.guest-benefits {
    list-style: none;
    padding: 0;
    margin: 15px 0;
    text-align: left;
}

.guest-benefits li {
    padding: 6px 0;
    color: #28A745;
    font-size: 14px;
}

.guest-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.guest-btn {
    padding: 14px 25px;
    font-size: 16px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}

.guest-create {
    background: linear-gradient(135deg, #C41E3A, #FF6B6B);
    color: white;
}

.guest-signin {
    background: linear-gradient(135deg, #2563EB, #3B82F6);
    color: white;
}

.guest-continue {
    background: #E8E8E8;
    color: #666;
}

/* End Screen */
.end-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #C41E3A 0%, #8B0000 100%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.end-screen.active {
    display: flex;
}

.end-content {
    text-align: center;
    color: white;
    animation: fadeIn 0.5s ease;
}

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

.end-content h1 {
    font-size: 40px;
    margin-bottom: 20px;
}

.end-stats {
    display: flex;
    gap: 25px;
    justify-content: center;
    margin: 25px 0;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.8;
    text-transform: uppercase;
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
}

.end-message {
    font-size: 20px;
    margin-bottom: 15px;
    padding: 10px 25px;
    background: rgba(255,255,255,0.2);
    border-radius: 25px;
    display: inline-block;
}

.review-info {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 20px;
    padding: 8px 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
}

.end-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.play-again-btn, .continue-btn {
    padding: 14px 35px;
    font-size: 16px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.play-again-btn {
    background: white;
    color: #C41E3A;
}

.continue-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
}

.play-again-btn:hover, .continue-btn:hover {
    transform: scale(1.05);
}

/* Start Screen */
.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(240, 248, 255, 0.6) 100%),
                url('/basic/assets/images/background_C0.png') center/cover no-repeat;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 400;
}

.start-screen.active {
    display: flex;
}

.start-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.start-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.user-status {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.user-status.logged-in {
    color: #059669;
}

.signin-link {
    font-size: 14px;
    color: #2563EB;
    text-decoration: none;
    font-weight: 600;
}

.signin-link:hover {
    text-decoration: underline;
}

.logout-link {
    font-size: 14px;
    color: #dc2626;
    text-decoration: none;
    font-weight: 500;
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid #e5e7eb;
}

.logout-link:hover {
    text-decoration: underline;
}

.start-content {
    text-align: center;
    color: #1E40AF;
    width: 100%;
    max-width: 600px;
    max-height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 60px 20px 30px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    margin: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.start-header {
    padding-top: 20px;
    margin-bottom: 15px;
}

.start-content h1 {
    font-size: 52px;
    margin-bottom: 5px;
    color: #C41E3A;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.start-content h2 {
    font-size: 26px;
    font-weight: normal;
    margin-bottom: 10px;
    color: #1E40AF;
}

.start-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.start-middle {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.start-middle > p {
    font-size: 18px;
    margin-bottom: 10px;
    color: #1a1a1a;
    font-weight: 500;
    text-align: center;
}

.start-info {
    margin: 20px 0;
    text-align: center;
}

.info-item {
    font-size: 16px;
    margin-bottom: 10px;
    color: #1a1a1a;
    font-weight: 500;
}

.start-bottom {
    padding-bottom: 20px;
    text-align: center;
}

.start-action {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 10px;
}

.start-car {
    width: 80px;
    height: auto;
}

.start-btn {
    padding: 16px 45px;
    font-size: 18px;
    background: linear-gradient(135deg, #2563EB, #3B82F6);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
    box-shadow: 0 5px 20px rgba(37, 99, 235, 0.3);
}

.start-btn:hover {
    transform: scale(1.05);
}

.guest-note {
    margin-top: 20px;
    font-size: 13px;
    color: #6B7280;
}

/* Resume Prompt */
.resume-prompt {
    margin-bottom: 20px;
}

.resume-box {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #2563EB;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}

.resume-title {
    font-size: 18px;
    font-weight: bold;
    color: #1E40AF;
    margin-bottom: 8px;
}

.resume-stats {
    font-size: 14px;
    color: #4B5563;
    margin-bottom: 15px;
}

.resume-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.resume-btn {
    padding: 12px 25px;
    font-size: 16px;
    background: linear-gradient(135deg, #2563EB, #3B82F6);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}

.resume-btn:hover {
    transform: scale(1.05);
}

.start-over-btn {
    padding: 12px 20px;
    font-size: 14px;
    background: #E5E7EB;
    color: #4B5563;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.2s;
}

.start-over-btn:hover {
    background: #D1D5DB;
}

/* Responsive */
@media (max-width: 600px) {
    .ui-bar {
        height: auto;
        min-height: 50px;
        padding: 8px 10px;
        gap: 5px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .ui-item {
        min-width: auto;
    }
    
    .level-indicator {
        display: none; /* Hide on mobile to save space */
    }
    
    .ui-value { font-size: 14px; }
    .ui-label { font-size: 8px; }
    .progress-container { max-width: 80px; flex: 1; }
    .progress-bar { height: 6px; }
    
    .pause-btn {
        font-size: 20px;
        padding: 4px 8px;
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .modal { padding: 20px; }
    .question-text { font-size: 16px; }
    .start-content h1 { font-size: 28px; }
    .start-content h2 { font-size: 18px; }
    .end-content h1 { font-size: 24px; }
    .stat-value { font-size: 24px; }
    .checkpoint-stats { gap: 15px; }
    .cp-stat-value { font-size: 24px; }
    
    /* Hide question counter text on very small screens */
    .question-counter .ui-label { display: none; }
    
    /* Start screen mobile */
    .start-top-bar {
        padding: 10px 15px;
    }
    
    .start-user-info {
        padding: 6px 12px;
        gap: 10px;
    }
    
    .user-status, .signin-link {
        font-size: 12px;
    }
    
    .back-home-link {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .start-content {
        padding: 50px 15px 20px;
    }
    
    .start-middle > p {
        font-size: 14px;
    }
    
    .info-item {
        font-size: 13px;
    }
    
    .start-car {
        width: 60px;
    }
    
    .start-btn {
        padding: 14px 30px;
        font-size: 16px;
    }
    
    .guest-note {
        font-size: 11px;
    }
    
    .unlock-info {
        margin-top: 15px;
        padding: 12px 15px;
    }
}


/* Upgrade Prompt Modal */
.upgrade-modal {
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(240,248,255,0.98));
    border: 2px solid #2563EB;
    max-width: 420px;
}

.upgrade-modal h2 {
    font-size: 24px;
    color: #1E40AF;
    margin-bottom: 15px;
}

.upgrade-modal p {
    font-size: 15px;
    color: #4B5563;
    line-height: 1.6;
    margin-bottom: 25px;
}

.upgrade-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upgrade-buttons .btn-primary {
    padding: 14px 30px;
    font-size: 16px;
    background: linear-gradient(135deg, #2563EB, #3B82F6);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

.upgrade-buttons .btn-primary:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.upgrade-buttons .btn-secondary {
    padding: 10px 20px;
    font-size: 14px;
    background: transparent;
    color: #6B7280;
    border: 1px solid #D1D5DB;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.upgrade-buttons .btn-secondary:hover {
    background: #F3F4F6;
}

/* Repetition indicator in end screen */
.repetition-notice {
    background: #FEF3C7;
    color: #92400E;
    padding: 8px 15px;
    border-radius: 10px;
    font-size: 13px;
    margin-top: 10px;
}


/* Beta Badge */
.beta-badge {
    display: inline-block;
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
    font-size: 14px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 12px;
    margin-left: 10px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 4px rgba(217, 119, 6, 0.3);
}

.beta-badge-small {
    display: inline-block;
    background: #F59E0B;
    color: white;
    font-size: 8px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 6px;
    margin-left: 4px;
    vertical-align: middle;
    text-transform: uppercase;
}


/* Unlock Info Box */
.unlock-info {
    background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
    border: 2px solid #93C5FD;
    border-radius: 12px;
    padding: 15px 20px;
    margin-top: 20px;
    text-align: center;
}

.unlock-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.unlock-text {
    font-size: 14px;
    font-weight: 600;
    color: #1E40AF;
    margin-bottom: 4px;
}

.unlock-detail {
    font-size: 12px;
    color: #3B82F6;
    margin: 0;
}

@media (max-width: 480px) {
    .unlock-info {
        padding: 12px 15px;
        margin-top: 15px;
    }
    
    .unlock-icon {
        font-size: 24px;
    }
    
    .unlock-text {
        font-size: 13px;
    }
    
    .unlock-detail {
        font-size: 11px;
    }
}


/* Back to Home Link */
.back-home-link {
    color: #4B5563;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.back-home-link:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1F2937;
}

.start-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 15px 20px;
}
