
    /* ===== RESET & BASE STYLES ===== */
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
}

body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #8570ed;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

    h1, h2 {
        text-align: center;
        color: #333;
    }

    /* ===== HEADER STYLES ===== */
    #secondaryHeader {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    margin: 0 0 10px 0;
    border-radius: 0; /* Remove border radius for full width */
    width: 100%;
}

    #secondaryHeader p {
        font-size: 1.5rem;
        font-weight: bold;
        color: #4a5568;
        margin: 0 20px;
    }

    /* ===== INTRO SECTION ===== */
    .intro {
        display: flex;
        justify-content: center;
        gap: 15px;
        flex-wrap: wrap;
        padding: 20px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 20px;
        margin: 10px 0;
    }

    .intro button {
        padding: 12px 24px;
        font-size: 1.1rem;
        border: none;
        border-radius: 50px;
        background: white;
        color: #4a5568;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        font-weight: bold;
    }

    .intro button:hover {
        transform: translateY(-3px);
        background: #4CAF50;
        color: white;
    }

    /* ===== CANVAS WRAPPER ===== */
    .canvas-wrapper {
        margin: 20px auto;
        text-align: center;
        width: 100%;
        max-width: 1000px;
        background-color: white;
        padding: 0 15px 20px;
        border-radius: 15px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        overflow: auto;
    }

    .canvas-wrapper, 
.lesson-container, 
.lesson3D,
#quizSection,
.intro {
    max-width: 1200px;
    margin: 0 auto !important;
    width: 100%;
    padding: 15px;
}
    /* ===== SHAPE CONTAINERS ===== */
   .MainShape-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 10px;
}

    .MainShape-container p {
        margin-bottom: 10px;
        color: #2d3748;
    }

    .MainShape-container > p:first-of-type {
        font-size: 1.8rem;
        font-weight: bold;
        color: #4CAF50;
    }
.shape-intro {
    text-align: center;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 12px;
    border-radius: 12px;
    color: white;
}

.shape-intro p {
    margin: 3px 0;
    color: white;
}

.shape-intro .compact-text {
    font-size: 0.95rem;
    opacity: 0.95;
}

.shape-intro .compact-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}
    .shape-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 15px;
        padding: 10px;
        max-width: 900px;
        margin: 0 auto;
    }

.shape-group.compact {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
}

.shape-group-title {
    margin: 0 0 8px 0;
    padding-bottom: 5px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.shape-count {
    font-size: 0.8rem;
    background: #4CAF50;
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: normal;
}

.shape-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
}

.shape.compact {
    width: auto;
    min-width: 70px;
    max-width: 80px;
    padding: 6px 4px;
    margin: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.shape.compact:hover {
    transform: translateY(-2px);
    border-color: #4CAF50;
    box-shadow: 0 3px 8px rgba(76, 175, 80, 0.2);
}

.shape.compact img {
    width: 40px;
    height: 40px;
    margin: 0 auto 3px;
}

.shape-name {
    font-size: 0.7rem;
    font-weight: bold;
    color: #333;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 2px;
}

/* Compact description */
.shape.compact .description {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 100%;
    width: 150px;
    background: #333;
    color: white;
    font-size: 0.7rem;
    padding: 6px 8px;
    border-radius: 6px;
    z-index: 100;
    margin-top: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    border: none;
    text-align: left;
}

.shape.compact .description::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #333;
}

.shape.compact .description button {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 2px 5px;
    font-size: 0.6rem;
    border-radius: 4px;
    margin-top: 4px;
}

.shape.compact .description button:hover {
    background: rgba(255,255,255,0.3);
}

    .lesson3D .shape {
        max-width: 200px;
        padding: 15px;
    }

    .shape:hover {
        transform: translateY(-5px);
        border-color: #4CAF50;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

    .shape.active {
        border-color: #4CAF50;
        background: #f0f9ff;
        transform: scale(1.02);
    }

    .shape img {
        width: 80px;
        height: 80px;
        object-fit: contain;
        margin: 0 auto 8px;
        transition: transform 0.3s ease;
    }

    .lesson3D .shape img {
        width: 150px;
        height: 150px;
    }

    .shape:hover img {
        transform: scale(1.05);
    }

/* Responsive adjustments */
@media (max-width: 768px) {
    .shape-row {
        gap: 5px;
    }
    
    .shape.compact {
        min-width: 60px;
        max-width: 70px;
    }
    
    .shape.compact img {
        width: 35px;
        height: 35px;
    }
    
    .shape-name {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .shape-row {
        justify-content: center;
    }
    
    .shape.compact {
        min-width: 55px;
        max-width: 60px;
    }
    
    .shape.compact img {
        width: 30px;
        height: 30px;
    }
}
    /* ===== DESCRIPTION STYLES ===== */
    .description {
        position: relative;
        background: #f0f9ff;
        border: 2px solid #4CAF50;
        border-radius: 10px;
        padding: 15px;
        margin-top: 15px;
        color: #666;
        font-size: 0.95rem;
        opacity: 0;
        transition: opacity 0.5s;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }

    .description.show {
        opacity: 1;
        animation: slideDown 0.3s ease;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .description button {
        background: none;
        border: none;
        font-size: 18px;
        cursor: pointer;
        color: #666;
        padding: 0 8px;
        border-radius: 50%;
        transition: all 0.3s ease;
    }

    .description button:hover {
        background: #ff4444;
        color: white;
    }

    /* ===== LESSON CONTAINERS ===== */
    .lesson-container, .lesson3D {
        background: rgba(255, 255, 255, 0.95);
        border-radius: 30px;
        padding: 30px;
        margin: 20px 0;
    }

    .shape-list, .list3D {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
        justify-content: center;
    }

    .Lshape-container {
        width: 150px;
        padding: 15px;
        border-radius: 12px;
        text-align: center;
        background-color: #dbc3c3;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        transition: background-color 0.3s ease;
    }

    .Lshape-container:hover {
        background-color: #d0f0ff;
    }

    .shape-title {
        color: #333;
        font-weight: bold;
        margin-bottom: 8px;
    }

    .shape-example {
        margin-top: 8px;
        font-size: 14px;
    }

    .shape-example img {
        width: 30px;
        height: 30px;
        vertical-align: middle;
        margin-right: 5px;
    }

    /* Canvas elements */
    canvas {
        margin-top: 10px;
        width: 100px;
        height: 100px;
        max-width: 100%;
        touch-action: manipulation;
    }

    .lesson3D canvas {
        width: 200px;
        height: 100px;
    }

    /* ===== QUIZ SECTION ===== */
    #quizSection {
        display: none;
        text-align: center;
        width: 100%;
        max-width: 800px;
        margin: 0 auto;
        overflow: auto;
        padding: 15px;
    }

    #quizSection.fullscreen-active {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%) !important;
        margin: 0 !important;
        padding: 20px !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        z-index: 10000 !important;
        overflow-y: auto !important;
    }

    #quizSection.fullscreen-active > * {
        max-width: 800px !important;
        width: 100% !important;
        margin: 0 auto !important;
    }

    /* Quiz type containers */
    #quizType0, #quizType1, #quizType2, #quizType3 {
        max-width: 700px;
        margin: 0 auto;
        padding: 15px;
    }

    /* Quiz Type 0 specific */
    #quizType0 {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-radius: 30px;
        box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    }

    .quiz-header {
        background: rgba(255, 255, 255, 0.95);
        border-radius: 20px;
        padding: 15px;
        margin-bottom: 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 15px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }

    .quiz-header h3 {
        margin: 0;
        color: #4a5568;
        font-size: 1.5rem;
    }

    .quiz-stats {
        display: flex;
        gap: 15px;
        align-items: center;
    }

    .score-badge {
        background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
        padding: 8px 16px;
        border-radius: 50px;
        font-weight: bold;
        color: white;
        font-size: 1rem;
        box-shadow: 0 4px 10px rgba(253, 160, 133, 0.3);
    }

    .question-counter {
        background: #4a5568;
        padding: 8px 16px;
        border-radius: 50px;
        font-weight: bold;
        color: white;
        font-size: 1rem;
        box-shadow: 0 4px 10px rgba(74, 85, 104, 0.3);
    }

    .question-container {
        background: rgba(255, 255, 255, 0.95);
        border-radius: 25px;
        padding: 20px;
        margin-bottom: 20px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    }

    .question-card {
        max-width: 600px;
        margin: 0 auto;
    }

    .question-image-container {
        text-align: center;
        margin-bottom: 20px;
        min-height: 120px;
    }

    .question-image-container img {
        max-width: 150px;
        max-height: 150px;
        border-radius: 15px;
        box-shadow: 0 8px 20px rgba(0,0,0,0.2);
        background: white;
        padding: 10px;
    }

    .question-text {
        font-size: 1.3rem;
        font-weight: bold;
        color: #2d3748;
        text-align: center;
        margin-bottom: 20px;
        padding: 15px;
        background: #f7fafc;
        border-radius: 15px;
        border-left: 5px solid #4CAF50;
    }

    .options-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 10px;
        margin: 20px 0;
    }

    .option-btn {
        padding: 12px 20px;
        font-size: 1rem;
        font-weight: 600;
        border: none;
        border-radius: 12px;
        background: white;
        color: #4a5568;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .option-btn.correct-answer {
        background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
        color: white;
    }

    .option-btn.wrong-answer {
        background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
        color: white;
    }

    .option-btn:disabled {
        opacity: 0.7;
        cursor: not-allowed;
    }

    .feedback-message {
        text-align: center;
        padding: 15px;
        margin: 15px 0;
        border-radius: 12px;
        font-size: 1.2rem;
        font-weight: bold;
    }

    .feedback-message.correct {
        background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
        color: #2e7d32;
        border: 2px solid #4CAF50;
    }

    .feedback-message.wrong {
        background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
        color: #c62828;
        border: 2px solid #f44336;
    }

    .feedback-message.warning {
        background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
        color: #ef6c00;
        border: 2px solid #ff9800;
    }

    .quiz-footer {
        display: flex;
        justify-content: center;
        margin-top: 20px;
    }

    .next-btn {
        padding: 15px 35px;
        font-size: 1.2rem;
        border: none;
        border-radius: 50px;
        background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
        color: white;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }

    .next-btn:hover:not(:disabled) {
        transform: translateY(-3px);
        box-shadow: 0 12px 25px rgba(76, 175, 80, 0.5);
    }

    .next-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .btn-icon {
        font-size: 1.3rem;
        transition: transform 0.3s ease;
    }

    .next-btn:hover .btn-icon {
        transform: translateX(5px);
    }

    .question-progress {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin: 20px 0;
    }

    .progress-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #e0e0e0;
        transition: all 0.3s ease;
    }

    .progress-dot.active {
        background: #4CAF50;
        transform: scale(1.2);
    }

    .progress-dot.completed {
        background: #4CAF50;
    }

    /* Quiz Type 2 specific */
    #quizType2 {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-radius: 25px;
        padding: 20px;
        border: 8px solid #ff6b6b;
    }

    #quizType3 {
        background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
        border-radius: 30px;
        padding: 20px;
        border: 10px solid #ff6b8b;
    }

    #quizProgress2, #quizProgress3 {
        background: #ffd93d;
        color: #333;
        padding: 10px 20px;
        border-radius: 50px;
        font-weight: bold;
        font-size: 1.1em;
        display: inline-block;
        margin: 10px 0;
    }

    /* ===== MATCHING GAME STYLES ===== */
    .object-container, #shapes {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
        padding: 15px;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 20px;
        margin: 15px 0;
    }

    .match-wrapper {
        position: relative;
        cursor: grab;
        transition: all 0.3s ease;
    }

    .match-wrapper.dragging {
        opacity: 0.7;
        transform: scale(1.05);
    }

    .match-item {
        background: white;
        border: 3px solid #6a89cc;
        border-radius: 15px;
        padding: 10px;
        text-align: center;
        font-weight: bold;
        box-shadow: 0 4px 0 #4a69bd;
        min-height: 80px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .match-item img.icon {
        width: 40px;
        height: 40px;
        object-fit: contain;
        margin-top: 5px;
    }

    .shape-target {
        background: linear-gradient(145deg, #f8f9fa, #e9ecef);
        border: 4px dashed #4ecdc4;
        border-radius: 15px;
        min-height: 100px;
        padding: 10px;
        margin-top: 5px;
        position: relative;
    }

    .shape-target.highlight {
        background: #e3f2fd;
        border-color: #2196f3;
    }

    .shape-target.drag-over {
        background: #c8e6c9;
        border-color: #66bb6a;
    }

    .mark-overlay {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0);
        font-size: 2em;
        transition: transform 0.3s ease;
        pointer-events: none;
    }

    .mark-overlay.show {
        transform: translate(-50%, -50%) scale(1);
    }

    .correct-mark {
        color: #4caf50;
    }

    .wrong-mark {
        color: #f44336;
    }

    /* ===== SELECTABLE ITEMS ===== */
    #selectableItems {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 10px;
        padding: 15px;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 20px;
        margin: 15px 0;
    }

    .selectable-wrapper {
        position: relative;
        cursor: pointer;
        text-align: center;
    }

    .selectable {
        width: 80px;
        height: 80px;
        object-fit: contain;
        border: 3px solid transparent;
        border-radius: 10px;
        transition: all 0.3s ease;
    }

    .selectable.selected {
        border-color: #4CAF50;
        transform: scale(1.05);
    }

    .selectable-wrapper .mark-overlay {
        font-size: 2.5em;
    }

    /* ===== BUTTONS ===== */
    button {
        padding: 10px 20px;
        background-color: #1aaecc;
        border: none;
        color: white;
        border-radius: 8px;
        cursor: pointer;
        transition: background-color 0.3s ease;
        font-size: 1rem;
    }

    button:hover {
        background-color: #1c5e70;
    }

    button:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .quiz-nav-buttons {
        display: flex;
        justify-content: space-between;
        margin-top: 20px;
        gap: 10px;
    }

    .prev-btn {
        background-color: #f0f0f0;
        color: #333;
    }

    .next-btn {
        background-color: #4CAF50;
        color: white;
    }

    .quiz-button, .quiz-button-3 {
        padding: 12px 25px;
        border-radius: 50px;
        font-weight: bold;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    /* ===== DIALOGS ===== */
    .dialog-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 19999;
        display: none;
    }

    .dialog-overlay.active {
        display: block;
    }

    .result-dialog,
    #endDialog2,
    #endDialog3,
    #labelQuizDialog,
    #quiz-result-dialog {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        background: white;
        padding: 25px;
        border-radius: 20px;
        box-shadow: 0 20px 60px rgba(0,0,0,0.3);
        z-index: 20000 !important;
        max-width: 350px;
        width: 90%;
        text-align: center;
        animation: dialogPop 0.3s ease-out;
    }

    #endDialog2, #endDialog3 {
        display: none;
    }

    .result-content {
        background: white;
        border-radius: 30px;
        text-align: center;
    }

    .close-btn, .close-dialog-btn {
        position: absolute;
        top: 10px;
        right: 15px;
        background: transparent;
        border: none;
        font-size: 22px;
        cursor: pointer;
        color: #666;
        transition: all 0.3s ease;
    }

    .close-btn:hover, .close-dialog-btn:hover {
        color: #ff4444;
        transform: rotate(90deg);
    }

    .result-image {
        width: 100px;
        height: 100px;
        object-fit: contain;
        margin: 15px auto;
    }

    .score-circle {
        width: 120px;
        height: 120px;
        border-radius: 50%;
        background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 15px auto;
        box-shadow: 0 10px 30px rgba(76, 175, 80, 0.3);
    }

    .score-number {
        font-size: 3rem;
        font-weight: bold;
        color: white;
    }

    .score-total {
        font-size: 1.5rem;
        color: rgba(255,255,255,0.8);
        align-self: flex-end;
        margin-bottom: 5px;
    }

    .result-buttons {
        display: flex;
        gap: 10px;
        margin-top: 20px;
    }

    .restart-btn, .back-btn, .dialog-btn {
        flex: 1;
        padding: 12px 15px;
        border: none;
        border-radius: 12px;
        font-size: 1rem;
        font-weight: bold;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .restart-btn, .dialog-btn {
        background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
        color: white;
    }

    .back-btn {
        background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
        color: white;
    }

    .restart-btn:hover, .back-btn:hover, .dialog-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    }

    /* ===== ANIMATIONS ===== */
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes dialogPop {
        0% {
            opacity: 0;
            transform: translate(-50%, -50%) scale(0.8);
        }
        100% {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }
    }

    @keyframes pulse {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.05); }
    }

    @keyframes shake {
        0%, 100% { transform: translateX(0); }
        25% { transform: translateX(-5px); }
        75% { transform: translateX(5px); }
    }

    @keyframes confettiFall {
        0% {
            transform: translateY(-100vh) rotate(0deg);
            opacity: 1;
        }
        100% {
            transform: translateY(100vh) rotate(720deg);
            opacity: 0;
        }
    }

    .correct-anim {
        animation: pulse 0.5s ease;
    }

    .wrong-anim {
        animation: shake 0.4s ease;
    }

    .confetti {
        position: fixed;
        width: 8px;
        height: 8px;
        background: #4CAF50;
        animation: confettiFall 3s ease-out forwards;
        z-index: 9999;
        pointer-events: none;
    }

    .temp-msg.center {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: linear-gradient(135deg, #ff6b8b, #ff8e53);
        color: white;
        padding: 15px 25px;
        border-radius: 50px;
        font-size: 1.2rem;
        font-weight: bold;
        box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        z-index: 21000;
        animation: messagePop 0.3s ease-out;
    }

    .temp-msg.fade-out {
        animation: messageFade 0.4s ease-in forwards;
    }

    @keyframes messagePop {
        0% { transform: translate(-50%, -50%) scale(0); }
        80% { transform: translate(-50%, -50%) scale(1.1); }
        100% { transform: translate(-50%, -50%) scale(1); }
    }

    @keyframes messageFade {
        0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
        100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    }

    /* ===== PROGRESS BAR ===== */
    #progressBarContainer {
        width: 100%;
        background-color: #eee;
        height: 15px;
        border-radius: 10px;
        margin: 15px auto;
        overflow: hidden;
    }

    #progressBar {
        height: 100%;
        width: 0%;
        background-color: #4CAF50;
        transition: width 0.3s ease;
    }

    /* ===== BACK BUTTON ===== */
    #b2Sbutton {
        margin: 20px 0;
        text-align: left;
    }

    #b2Sbutton button {
        padding: 12px 25px;
        background: #ff6b6b;
        color: white;
        border: none;
        border-radius: 50px;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    #b2Sbutton button:hover {
        transform: translateX(-5px);
        box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    }

    /* ===== RESPONSIVE DESIGN ===== */
    @media (max-width: 768px) {
        body {
            padding: 0 10px;
        }

        .canvas-wrapper {
            width: 100%;
            padding: 0 10px 15px;
        }

        .shape-group {
            grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
            gap: 8px;
            padding: 10px;
        }

        .shape {
            max-width: 80px;
            padding: 8px;
        }

        .shape img {
            width: 60px;
            height: 60px;
        }

        .lesson3D .shape {
            max-width: 150px;
        }

        .lesson3D .shape img {
            width: 100px;
            height: 100px;
        }

        .shape-group-title {
            font-size: 1em;
        }

        .quiz-header {
            flex-direction: column;
            text-align: center;
        }

        .quiz-stats {
            flex-direction: column;
            width: 100%;
        }

        .score-badge, .question-counter {
            width: 100%;
            text-align: center;
        }

        .options-grid {
            grid-template-columns: 1fr;
        }

        .option-btn {
            padding: 12px;
        }

        .result-buttons {
            flex-direction: column;
        }

        #selectableItems {
            grid-template-columns: repeat(2, 1fr);
        }

        .selectable {
            width: 70px;
            height: 70px;
        }
    }

    @media (min-width: 1024px) {
        .shape-group {
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        }

        .shape {
            max-width: 120px;
        }

        .shape img {
            width: 100px;
            height: 100px;
        }
    }

    /* ===== UTILITY CLASSES ===== */
    .fade-in {
        animation: fadeIn 0.5s ease-in;
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    .slide-in {
        animation: slideIn 0.5s ease;
    }

    @keyframes slideIn {
        from {
            opacity: 0;
            transform: translateX(30px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .disabled-button {
        opacity: 0.6;
        cursor: not-allowed;
        pointer-events: none;
    }

    #nextBtn0 {
        opacity: 0;
        transform: translateY(15px);
        transition: all 0.4s ease;
    }

    #nextBtn0.slide-in {
        opacity: 1;
        transform: translateY(0);
    }

    /* ===== FULLSCREEN DIALOG FIXES ===== */
    .fullscreen-active .dialog-overlay {
        z-index: 20000;
    }

    .fullscreen-active .result-dialog,
    .fullscreen-active #endDialog2,
    .fullscreen-active #endDialog3,
    .fullscreen-active #labelQuizDialog,
    .fullscreen-active #quiz-result-dialog {
        z-index: 21000;
    }

    @supports (-webkit-touch-callout: none) {
        .result-dialog,
        #endDialog2,
        #endDialog3,
        #labelQuizDialog,
        #quiz-result-dialog {
            position: fixed !important;
            top: 50% !important;
            left: 50% !important;
            transform: translate(-50%, -50%) !important;
        }
    }

    /* ===== FOOTER ===== */
    footer {
    margin-top: auto;
    width: 100%;
    background-color: #333;
    color: white;
    text-align: center;
    padding: 15px 0;
    font-size: 0.9rem;
    border-radius: 0; /* Remove border radius for full width */
    margin-top: 20px;
}
    /* Label Quiz Dropdown Styles */
.label-quiz {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    border-radius: 30px;
    padding: 25px;
    box-shadow: 0 20px 40px rgba(67, 233, 123, 0.3);
    border: 8px solid #ffd93d;
}

.label-quiz-header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 15px 20px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.label-quiz-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.label-quiz-title h3 {
    margin: 0;
    color: #333;
    font-size: 1.3rem;
}

.quiz-icon {
    font-size: 1.8rem;
}

.label-quiz-progress {
    display: flex;
    gap: 15px;
    align-items: center;
}

.progress-badge {
    background: #ff6b6b;
    color: white;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 0.95rem;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.3);
}

.label-quiz-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.label-quiz-image {
    text-align: center;
    margin-bottom: 30px;
}

.quiz-shape-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    background: white;
    padding: 15px;
    border: 4px solid #ffd93d;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.label-quiz-form {
    max-width: 500px;
    margin: 0 auto;
}

.label-section {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
}

.label-section h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.1rem;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px dashed #4CAF50;
}

.dropdown-item {
    margin-bottom: 15px;
    padding: 12px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}


.dropdown-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dropdown-label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px; /* Fixed width for label */
    flex-shrink: 0;
}
.label-letter {
    display: inline-block;
    width: 28px;
    height: 28px;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 2px 5px rgba(255, 107, 107, 0.3);
}

.label-text {
    color: #555;
    font-weight: 500;
    font-size: 0.95rem;
}

.dropdown-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 200px;
}

.quiz-dropdown {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 0.95rem;
    color: #333;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

.quiz-dropdown:hover:not(:disabled) {
    border-color: #4CAF50;
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.1);
}

.quiz-dropdown:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.quiz-dropdown:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.8;
}

.shape-dropdown {
    background: #fff3e0;
    border: 2px solid #ff9800;
}

.shape-dropdown .label-letter {
    background: #ff9800;
}

.correct-indicator {
    min-width: 80px;
    font-size: 0.9rem;
    font-weight: bold;
    text-align: right;
    flex-shrink: 0;
}

.correct-indicator.correct {
    color: #4CAF50;
}

.correct-indicator.incorrect {
    color: #f44336;
}

.submit-label-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
}

.submit-label-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(76, 175, 80, 0.5);
}

.submit-label-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.label-quiz-result {
    margin-top: 20px;
}

.result-badge {
    padding: 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.5s ease;
}

.result-badge.perfect {
    background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%);
    border: 2px solid #ffd700;
}

.result-badge.good {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #4CAF50;
}

.result-icon {
    font-size: 1.5rem;
}

.result-text {
    font-weight: bold;
    color: #333;
}

.result-score {
    background: white;
    padding: 5px 15px;
    border-radius: 50px;
    font-weight: bold;
    color: #4CAF50;
}

.next-label-btn {
    padding: 15px 40px;
    background: linear-gradient(135deg, #ffd93d 0%, #ffb347 100%);
    color: #333;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: 0 8px 20px rgba(255, 193, 7, 0.4);
    margin: 0 auto;
}

.next-label-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 25px rgba(255, 193, 7, 0.5);
}

.next-label-btn .btn-icon {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.next-label-btn:hover .btn-icon {
    transform: translateX(5px);
}

.mini-confetti {
    position: absolute;
    width: 6px;
    height: 6px;
    animation: miniConfettiFall 1s ease-out forwards;
    pointer-events: none;
    z-index: 10;
}

@keyframes miniConfettiFall {
    0% {
        transform: translateY(-50px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .label-quiz {
        padding: 15px;
    }
    
    .label-quiz-header {
        flex-direction: column;
        text-align: center;
    }
    
    .label-quiz-progress {
        flex-direction: column;
        width: 100%;
    }
    
    .progress-badge, .score-badge {
        width: 100%;
        text-align: center;
    }
    
      /* Make dropdown wrapper take remaining space */
    .dropdown-wrapper {
        flex: 1 !important;
        min-width: 0 !important; /* Allow it to shrink */
        gap: 5px !important;
    }
    
    
        /* Compact indicator */
    .correct-indicator {
        min-width: 50px !important;
        font-size: 0.75rem !important;
        margin-top: 0 !important;
        text-align: right !important;
        white-space: nowrap !important;
    }

    
    
   .dropdown-item {
        flex-direction: row !important; /* Force row layout */
        align-items: center !important;
        gap: 8px !important;
        padding: 8px 10px !important;
        margin-bottom: 10px !important;
    }
    
   .dropdown-label {
        min-width: auto !important;
        width: auto !important;
        flex-shrink: 0 !important;
    }
     .label-text {
        font-size: 0.85rem !important;
        white-space: nowrap !important;
    }
    
    .label-letter {
        width: 22px !important;
        height: 22px !important;
        line-height: 22px !important;
        font-size: 0.8rem !important;
        flex-shrink: 0 !important;
    }
      .quiz-dropdown {
        padding: 8px 25px 8px 10px !important;
        font-size: 0.8rem !important;
        background-position: right 5px center !important;
        background-size: 12px !important;
        min-width: 0 !important;
        width: 100% !important;
    }
}

@media (max-width: 480px) {
       .dropdown-item {
            padding: 6px 8px !important;
            gap: 5px !important;
        }
       .label-text {
            font-size: 0.75rem !important;
        }
    .dropdown-label {
        font-size: 0.9rem;
    }
    
 .dropdown-item {
        padding: 10px;
    }
      .label-letter {
            width: 20px !important;
            height: 20px !important;
            line-height: 20px !important;
            font-size: 0.7rem !important;
        }
    
    .result-badge {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
      .quiz-dropdown {
            padding: 6px 22px 6px 8px !important;
            font-size: 0.7rem !important;
        }
        .correct-indicator {
            min-width: 45px !important;
            font-size: 0.7rem !important;
        }
}


/* For tablets - medium screens */
@media (min-width: 769px) and (max-width: 1024px) {
    .dropdown-item {
        gap: 10px !important;
    }
    
    .dropdown-label {
        min-width: 160px !important;
    }
    
    .dropdown-wrapper {
        min-width: 180px !important;
    }
}
/* Pattern Quiz Styles */
.pattern-quiz {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    border-radius: 30px;
    padding: 25px;
    box-shadow: 0 20px 40px rgba(255, 154, 158, 0.3);
    border: 8px solid #ffd93d;
}

.pattern-quiz-header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 15px 20px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.pattern-quiz-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pattern-quiz-title h3 {
    margin: 0;
    color: #333;
    font-size: 1.3rem;
}

.pattern-quiz-progress {
    display: flex;
    gap: 15px;
    align-items: center;
}

.pattern-quiz-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.pattern-question-card {
    max-width: 600px;
    margin: 0 auto;
}

.pattern-question-card h4 {
    text-align: center;
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.pattern-display {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 20px;
    border: 3px dashed #ff9a9e;
}

.pattern-box {
    width: 60px;
    height: 70px;
    background: white;
    border: 3px solid #4CAF50;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    animation: fadeIn 0.5s ease;
}

.pattern-box.pattern-unknown {
    border-color: #ff9800;
    background: #fff3e0;
    animation: pulse 1.5s infinite;
}

.pattern-box.pattern-unknown.correct {
    border-color: #4CAF50;
    background: #e8f5e9;
    animation: celebrate 0.5s ease;
}

.pattern-box.pattern-unknown.wrong {
    border-color: #f44336;
    background: #ffebee;
    animation: shake 0.5s ease;
}

.pattern-shape {
    font-size: 1.8rem;
    line-height: 1;
}

.pattern-position {
    font-size: 0.7rem;
    color: #666;
    margin-top: 5px;
}

.pattern-options {
    margin-top: 30px;
}

.pattern-question {
    text-align: center;
    color: #333;
    font-weight: bold;
    margin-bottom: 20px;
}

.pattern-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
    justify-content: center;
    max-width: 400px;
    margin: 0 auto;
}

.pattern-option-btn {
    padding: 15px;
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.pattern-option-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    border-color: #4CAF50;
    box-shadow: 0 8px 15px rgba(76, 175, 80, 0.2);
}

.pattern-option-btn.correct-answer {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-color: #2E7D32;
}

.pattern-option-btn.wrong-answer {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    border-color: #b71c1c;
}

.pattern-option-btn.correct-answer .option-shape,
.pattern-option-btn.wrong-answer .option-shape {
    color: white;
}

.option-shape {
    font-size: 2rem;
    display: block;
}

.pattern-feedback {
    margin-top: 30px;
    text-align: center;
}

.pattern-feedback.correct,
.pattern-feedback.wrong {
    padding: 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: slideIn 0.5s ease;
}

.pattern-feedback.correct {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #4CAF50;
    color: #2e7d32;
}

.pattern-feedback.wrong {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border: 2px solid #f44336;
    color: #c62828;
}

.feedback-icon {
    font-size: 1.5rem;
}

.feedback-text {
    font-size: 1rem;
    font-weight: 500;
}

.next-pattern-btn {
    padding: 15px 40px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    color: #333;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: 0 8px 20px rgba(255, 154, 158, 0.4);
    margin: 20px auto 0;
}

.next-pattern-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 25px rgba(255, 154, 158, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .pattern-box {
        width: 45px;
        height: 55px;
    }
    
    .pattern-shape {
        font-size: 1.4rem;
    }
    
    .pattern-position {
        font-size: 0.6rem;
    }
    
    .pattern-options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pattern-quiz-header {
        flex-direction: column;
        text-align: center;
    }
    
    .pattern-quiz-progress {
        flex-direction: column;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .pattern-box {
        width: 35px;
        height: 45px;
    }
    
    .pattern-shape {
        font-size: 1.2rem;
    }
    
    .pattern-option-btn {
        padding: 10px;
    }
    
    .option-shape {
        font-size: 1.5rem;
    }
}

/* Tile Pattern Quiz Styles */
.tile-quiz {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    border-radius: 30px;
    padding: 25px;
    box-shadow: 0 20px 40px rgba(67, 233, 123, 0.3);
    border: 8px solid #ffd93d;
}

.tile-quiz-header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 15px 20px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.tile-quiz-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tile-quiz-title h3 {
    margin: 0;
    color: #333;
    font-size: 1.3rem;
}

.tile-quiz-progress {
    display: flex;
    gap: 15px;
    align-items: center;
}

.tile-quiz-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.tile-question-card {
    max-width: 600px;
    margin: 0 auto;
}

.tile-question-card h4 {
    text-align: center;
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.tile-description {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
    font-style: italic;
}

.tile-pattern {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 20px;
    border: 3px solid #43e97b;
    margin: 0 auto 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 280px;
}
@keyframes tileCelebrate {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.05); filter: drop-shadow(0 0 10px #4CAF50); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 20px #4CAF50); }
    75% { transform: scale(1.05); filter: drop-shadow(0 0 10px #4CAF50); }
}

@keyframes tileShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.tile-question {
    text-align: center;
    color: #333;
    font-weight: bold;
    margin: 20px 0 15px;
    font-size: 1.1rem;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 10px;
}

.tile-shape-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    max-width: 500px;
    margin: 0 auto 20px;
}

.tile-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.tile-option:hover {
    transform: translateY(-2px);
    border-color: #43e97b;
    box-shadow: 0 6px 12px rgba(67, 233, 123, 0.2);
}

.tile-option.correct {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-color: #4CAF50;
}

.tile-option.incorrect {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-color: #f44336;
}

.tile-option.missed {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-color: #ff9800;
    border-style: dashed;
}

.tile-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #4CAF50;
}

.checkbox-custom {
    display: inline-block;
    width: 22px;
    height: 22px;
    background: white;
    border: 2px solid #43e97b;
    border-radius: 6px;
    position: relative;
}

.tile-checkbox:checked + .checkbox-custom::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #4CAF50;
    font-weight: bold;
    font-size: 1.2rem;
}

.counting-section {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 20px;
    margin: 15px 0;
    border: 2px dashed #43e97b;
}

.count-question {
    font-weight: bold;
    color: #333;
    margin: 20px 0 10px;
    padding-left: 10px;
    border-left: 4px solid #43e97b;
}

.count-question.second {
    border-left-color: #ff9800;
    margin-top: 30px;
}

.count-question.third {
    border-left-color: #9c27b0;
}

.tile-count-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.tile-count-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tile-count-option:hover {
    border-color: #43e97b;
    transform: translateY(-2px);
}

.tile-count-option.correct-answer {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-color: #4CAF50;
}

.tile-count-option.wrong-answer {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-color: #f44336;
}

.tile-radio {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4CAF50;
}

.radio-custom {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid #43e97b;
    border-radius: 50%;
    position: relative;
}

.tile-radio:checked + .radio-custom::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: #4CAF50;
    border-radius: 50%;
}

.submit-tile-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
    margin: 20px 0;
}

.submit-tile-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(76, 175, 80, 0.5);
}

.submit-tile-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tile-feedback {
    margin-top: 20px;
}

.tile-feedback.correct,
.tile-feedback.wrong {
    padding: 20px;
    border-radius: 15px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    animation: slideIn 0.5s ease;
}

.tile-feedback.correct {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #4CAF50;
}

.tile-feedback.wrong {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border: 2px solid #f44336;
}

.feedback-shapes {
    display: block;
    margin-top: 8px;
    font-weight: bold;
    color: #2e7d32;
    font-size: 1.1rem;
}

.next-tile-btn {
    padding: 15px 40px;
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: #333;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: 0 8px 20px rgba(67, 233, 123, 0.4);
    margin: 20px auto 0;
}

.next-tile-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 25px rgba(67, 233, 123, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .tile-svg {
        max-width: 250px;
    }
    
    .tile-shape-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tile-count-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tile-quiz-header {
        flex-direction: column;
        text-align: center;
    }
    
    .tile-quiz-progress {
        flex-direction: column;
        width: 100%;
    }
}

@media (max-width: 480px) {
   
    .tile-option {
        padding: 8px;
        font-size: 0.9rem;
    }
    
    .tile-count-option {
        padding: 8px;
        font-size: 0.9rem;
    }
    
    .tile-question {
        font-size: 1rem;
    }
    
    .count-question {
        font-size: 0.95rem;
    }
}

/* Lesson Section Styles */
.lesson-section {
    margin-bottom: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 20px;
    border-left: 8px solid #4CAF50;
}

.lesson-subtitle {
    color: #333;
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 3px solid #4CAF50;
}

/* Pattern Lesson Styles */
.pattern-lesson {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3d6 100%);
    border-left-color: #FF9800;
}

.pattern-description {
    color: #666;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.pattern-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.pattern-example-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.pattern-example-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(255, 152, 0, 0.2);
}

.pattern-example-card h4 {
    color: #FF9800;
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
}

.pattern-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 10px;
    min-height: 60px;
}

.pattern-shape-item {
    font-size: 2rem;
    display: inline-block;
    animation: fadeIn 0.5s ease;
}

.pattern-desc {
    text-align: center;
    color: #666;
    font-size: 0.95rem;
    margin: 0;
}

.pattern-note {
    background: #fff3e0;
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    border-left: 5px solid #FF9800;
}

/* Tessellation Lesson Styles */
.tessellation-lesson {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left-color: #2196F3;
}

.tessellation-description {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.1rem;
    font-weight: 500;
}

.tessellation-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.tessellation-example-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tessellation-example-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(33, 150, 243, 0.3);
}

.tessellation-example-card h4 {
    color: #2196F3;
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
}

.tessellation-visual {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 160px;
}

.tessellation-visual svg {
    max-width: 100%;
    height: auto;
}

.tessellation-desc {
    text-align: center;
    color: #555;
    font-size: 0.95rem;
    margin: 10px 0 0;
}

.tessellation-note {
    background: #e1f5fe;
    border-radius: 15px;
    padding: 20px;
    border-left: 5px solid #2196F3;
}

.tessellation-note p {
    margin-top: 0;
    font-weight: bold;
    color: #333;
}

.tessellation-note ul {
    margin-bottom: 0;
    padding-left: 20px;
}

.tessellation-note li {
    margin-bottom: 8px;
    color: #555;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pattern-examples,
    .tessellation-examples {
        grid-template-columns: 1fr;
    }
    
    .pattern-visual {
        flex-wrap: wrap;
    }
    
    .pattern-shape-item {
        font-size: 1.5rem;
    }
    
    .lesson-subtitle {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .pattern-shape-item {
        font-size: 1.2rem;
    }
    
    .tessellation-visual svg {
        width: 120px;
        height: auto;
    }
}

/* Mobile Drag and Drop Styles */
.match-wrapper {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: none;
    cursor: grab;
    transition: all 0.2s ease;
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 5px;
    display: inline-block;
}

.match-wrapper.dragging-original {
    opacity: 0.3 !important;
    pointer-events: none;
}

.match-wrapper.matched {
    cursor: default;
    pointer-events: none;
}

.dragging-clone {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    background: white;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transform: scale(1.05) rotate(2deg);
    transition: all 0.1s ease;
    opacity: 0.9 !important;
}

.shape-target {
    min-height: 100px;
    min-width: 100px;
    border: 3px dashed #ccc;
    border-radius: 15px;
    margin: 10px;
    padding: 10px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.shape-target.active-drop-zone {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    animation: pulse 1.5s infinite;
}

.shape-target.drag-over {
    border-color: #4CAF50 !important;
    background: rgba(76, 175, 80, 0.15) !important;
    transform: scale(1.02);
    border-width: 4px;
}

.shape-target.occupied {
    opacity: 0.7;
    cursor: not-allowed;
}

.shape-target.drop-success {
    animation: dropSuccess 0.5s ease;
}

@keyframes dropSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); background-color: rgba(76, 175, 80, 0.2); }
    100% { transform: scale(1); }
}

/* Mark overlays */
.mark-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    z-index: 10;
    pointer-events: none;
    animation: popIn 0.3s ease;
    text-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* Result badge */
.result-badge {
    padding: 15px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin: 15px 0;
    animation: slideIn 0.5s ease;
}

.result-badge.perfect {
    background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%);
    border: 2px solid #ffd700;
}

.result-badge.good {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #4CAF50;
}

.result-icon {
    font-size: 2rem;
}

.result-text {
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
}

.result-score {
    background: white;
    padding: 5px 15px;
    border-radius: 50px;
    font-weight: bold;
    color: #4CAF50;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #objects, #shapes {
        flex-direction: column;
        align-items: center;
    }
    
    .shape-target {
        min-height: 120px;
        min-width: 120px;
        width: 100%;
        max-width: 200px;
    }
    
    .match-wrapper {
        width: auto;
        max-width: 150px;
    }
    
    .result-badge {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .shape-target {
        min-height: 100px;
        min-width: 100px;
    }
    
    .mark-overlay {
        font-size: 1.5rem;
    }
}

/* Tessellation Building Animation Styles */
.tessellation-visual {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    padding: 15px;
    background: #f0f0f0;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
    min-height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tessellation-visual svg {
    background: rgba(255,255,255,0.5);
    border-radius: 10px;
    padding: 5px;
}

/* Hidden tiles - completely invisible */
.tile.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Building animation classes */
.tile {
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: center;
}

/* Different placement animations based on pattern type */
.squares-pattern .tile.placing {
    animation: placeSquare 0.4s ease-out forwards;
}

.triangles-pattern .tile.placing {
    animation: placeTriangle 0.4s ease-out forwards;
}

.hexagon-pattern .tile.placing {
    animation: placeHexagon 0.4s ease-out forwards;
}

.mixed-pattern .tile.placing {
    animation: placeMixed 0.4s ease-out forwards;
}

/* Square placement animation */
@keyframes placeSquare {
    0% {
        opacity: 0;
        transform: scale(0.2) rotate(-45deg) translateY(30px);
        filter: brightness(2);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1) rotate(5deg) translateY(-5px);
        filter: brightness(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0) translateY(0);
        filter: brightness(1);
        visibility: visible;
    }
}

/* Triangle placement animation */
@keyframes placeTriangle {
    0% {
        opacity: 0;
        transform: scale(0.2) rotate(120deg) translateX(-30px);
        filter: brightness(2);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1) rotate(-10deg) translateX(5px);
        filter: brightness(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0) translateX(0);
        filter: brightness(1);
        visibility: visible;
    }
}

/* Hexagon placement animation */
@keyframes placeHexagon {
    0% {
        opacity: 0;
        transform: scale(0.2) rotate(180deg) translateY(-30px);
        filter: brightness(2);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1) rotate(-15deg) translateY(5px);
        filter: brightness(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0) translateY(0);
        filter: brightness(1);
        visibility: visible;
    }
}

/* Mixed shapes placement animation */
@keyframes placeMixed {
    0% {
        opacity: 0;
        transform: scale(0.2) rotate(90deg) translate(20px, 20px);
        filter: brightness(2);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1) rotate(-5deg) translate(-3px, -3px);
        filter: brightness(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0) translate(0, 0);
        filter: brightness(1);
        visibility: visible;
    }
}

/* Building button */
.build-animation-btn {
    margin-top: 15px;
    padding: 10px 25px;
    background: linear-gradient(135deg, #FF8C42 0%, #FF6B6B 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    border: 2px solid #fff;
}

.build-animation-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.build-animation-btn:active {
    transform: translateY(0);
}

.build-animation-btn.building {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    pointer-events: none;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Sound wave effect while building */
.tessellation-visual.building::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 20px;
    box-shadow: 0 0 0 rgba(255, 107, 107, 0.4);
    animation: soundWave 1.5s infinite;
    pointer-events: none;
}

@keyframes soundWave {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(255, 107, 107, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0);
    }
}

/* Row by row building effect */
.tile.placing[data-row="0"] { animation-delay: 0.1s; }
.tile.placing[data-row="1"] { animation-delay: 0.3s; }
.tile.placing[data-row="2"] { animation-delay: 0.6s; }
.tile.placing[data-row="3"] { animation-delay: 0.9s; }

/* Column variations for more dynamic effect */
.tile.placing[data-col="0"] { animation-duration: 0.4s; }
.tile.placing[data-col="1"] { animation-duration: 0.45s; }
.tile.placing[data-col="2"] { animation-duration: 0.5s; }
.tile.placing[data-col="3"] { animation-duration: 0.55s; }

/* Responsive */
@media (max-width: 768px) {
    .tessellation-visual svg {
        width: 130px;
        height: 130px;
    }
}

@media (max-width: 480px) {
    .tessellation-visual svg {
        width: 110px;
        height: 110px;
    }
    
    .build-animation-btn {
        padding: 8px 20px;
        font-size: 0.9rem;
    }
}


/* Hexagon Pattern with Diamond Shapes */
#pattern-hexagon {
    transition: all 0.3s ease;
}

/* Base styles for all shapes */
#pattern-hexagon polygon {
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Hexagon styles */
#pattern-hexagon .hexagon {
    fill-opacity: 1;
}

#pattern-hexagon .hexagon:hover {
    filter: brightness(1.2);
    transform: scale(1.02);
    stroke-width: 2;
    stroke: #000;
}

/* Diamond styles (horizontal) */
#pattern-hexagon .diamond {
    fill: #E6B800;
}

#pattern-hexagon .diamond:hover {
    fill: #FFD700;
    filter: brightness(1.3);
    transform: scale(1.05);
    stroke-width: 2;
    stroke: #000;
}

/* Diamond styles (vertical) */
#pattern-hexagon .diamond-vertical {
    fill: #CC9900;
}

#pattern-hexagon .diamond-vertical:hover {
    fill: #FFB347;
    filter: brightness(1.3);
    transform: scale(1.05);
    stroke-width: 2;
    stroke: #000;
}

/* Animation for counting */
@keyframes count-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); filter: brightness(1.3); }
    100% { transform: scale(1); }
}

#pattern-hexagon .hexagon.counting,
#pattern-hexagon .diamond.counting,
#pattern-hexagon .diamond-vertical.counting {
    animation: count-pulse 0.5s ease;
}

/* Legend for shape types */
.shape-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 15px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.legend-color.hexagon { background: #FFD700; }
.legend-color.diamond { background: #E6B800; }
.legend-color.diamond-vertical { background: #CC9900; }

/* Interactive demo note */
.shape-note {
    text-align: center;
    color: #666;
    font-style: italic;
    margin-top: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
}


/* ===== FIXED QUIZ TYPE 5 CSS ===== */
#quizType5 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 30px;
    padding: 25px;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
    border: 8px solid #ffd93d;
    margin: 20px auto;
    max-width: 800px;
}

.tessellation-quiz-header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 15px 20px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.tessellation-quiz-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tessellation-quiz-title h3 {
    margin: 0;
    color: #333;
    font-size: 1.3rem;
}

.tessellation-quiz-progress {
    display: flex;
    gap: 15px;
    align-items: center;
}

.tessellation-quiz-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.tessellation-question-card {
    max-width: 600px;
    margin: 0 auto;
}

.tessellation-question-card h4 {
    text-align: center;
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 20px;
    font-weight: bold;
}

.tessellation-description {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
    font-style: italic;
    font-size: 1.1rem;
}

.tessellation-grid {
    display: inline-block;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 20px;
    border: 3px solid #667eea;
    margin: 0 auto 25px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    width: 100%;
    text-align: center;
}

.tessellation-row {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 5px 0;
}

.tessellation-cell {
    display: inline-flex;
    width: 50px;
    height: 50px;
    font-size: 2rem;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.tessellation-cell:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

@keyframes celebrate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); background-color: #e8f5e9; }
}

.tessellation-options {
    margin-top: 30px;
}

.tessellation-question {
    text-align: center;
    color: #333;
    font-weight: bold;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.tessellation-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    justify-content: center;
    max-width: 500px;
    margin: 0 auto;
}

.tessellation-option-btn {
    padding: 15px 20px;
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    width: 100%;
}

.tessellation-option-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    border-color: #667eea;
    box-shadow: 0 8px 15px rgba(102, 126, 234, 0.2);
}

.tessellation-option-btn.correct-answer {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-color: #2E7D32;
    color: white;
}

.tessellation-option-btn.wrong-answer {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    border-color: #b71c1c;
    color: white;
}

.tessellation-feedback {
    margin-top: 30px;
}

.tessellation-feedback.correct,
.tessellation-feedback.wrong {
    padding: 20px;
    border-radius: 15px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    animation: slideIn 0.5s ease;
}

.tessellation-feedback.correct {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #4CAF50;
}

.tessellation-feedback.wrong {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border: 2px solid #f44336;
}

.feedback-content {
    flex: 1;
}

.feedback-explanation {
    display: block;
    margin-top: 8px;
    font-size: 0.95rem;
    color: #555;
    font-style: italic;
}

.next-tessellation-btn {
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    margin: 20px auto 0;
}

.next-tessellation-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 25px rgba(102, 126, 234, 0.5);
}

/* ===== PROGRESS BADGE FIX ===== */
.progress-badge {
    background: #ff6b6b;
    color: white;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 0.95rem;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.3);
    display: inline-block;
}

.score-badge {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: bold;
    color: white;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(253, 160, 133, 0.3);
    display: inline-block;
}

/* Responsive */
@media (max-width: 768px) {
    .tessellation-cell {
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
    
    .tessellation-options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tessellation-quiz-header {
        flex-direction: column;
        text-align: center;
    }
    
    .tessellation-quiz-progress {
        flex-direction: column;
        width: 100%;
    }
    
    .tessellation-feedback.correct,
    .tessellation-feedback.wrong {
        flex-direction: column;
        text-align: center;
    }
    
    #secondaryHeader p {
        font-size: 1.2rem;
        margin: 0 10px;
    }
}

@media (max-width: 480px) {
    .tessellation-cell {
        width: 25px;
        height: 25px;
        font-size: 1.2rem;
    }
    
    .tessellation-option-btn {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .tessellation-question {
        font-size: 1rem;
    }
    
    #secondaryHeader {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    #secondaryHeader p {
        font-size: 1rem;
        margin: 5px 0;
    }
}