
    :root {
        --bg-primary: #e8f8f5;
        --container-bg: #ffffff;
        --text-color: #2c3e50;
        --accent-green: #2ecc71;
        --accent-red: #ff7675;
        --accent-teal: #16a085;
        --parent-panel: #ffeaa7;
        --sandbox-bg: #f2fbf9;
        --basket-bg: #fffbf0;
        --supply-bg: #f9f9f9;
    }

    * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
        font-family: 'Comic Sans MS', 'Chalkboard SE', sans-serif;
    }

    body {
        background-color: var(--bg-primary);
        color: var(--text-color);
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
        padding: 80px 20px 20px 20px;
    }

    .game-window {
        background: var(--container-bg);
        border-radius: 24px;
        box-shadow: 0 15px 35px rgba(0,0,0,0.1);
        width: 100%;
        max-width: 855px;
        padding: 30px;
        text-align: center;
        border: 6px solid #b2eae2;
    }

    /* Parent Config Dashboard */
    .parent-config {
        background-color: var(--parent-panel);
        border: 3px dashed #d35400;
        border-radius: 16px;
        padding: 15px;
        margin-bottom: 25px;
    }

    .parent-title {
        font-size: 0.9rem;
        font-weight: bold;
        color: #d35400;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-bottom: 12px;
    }

    .parent-settings-row {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 20px;
        flex-wrap: wrap;
    }

    .parent-input-group {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .parent-input {
        height: 38px;
        font-size: 1rem;
        padding: 5px 10px;
        border: 2px solid #d35400;
        border-radius: 8px;
        outline: none;
    }
    
    .parent-input.name-input { width: 140px; }
    .parent-input.num-input { width: 65px; text-align: center; }

    .emoji-selector {
        display: flex;
        gap: 8px;
    }

    .emoji-opt {
        font-size: 1.6rem;
        background: white;
        border: 3px solid #ccc;
        border-radius: 12px;
        width: 44px;
        height: 44px;
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
        transition: all 0.2s ease;
    }

    .emoji-opt.selected {
        border-color: #e67e22;
        background-color: #fff2cc;
        transform: scale(1.1);
    }

    .btn-parent-load {
        background-color: #e67e22;
        color: white;
        border: none;
        padding: 8px 14px;
        font-weight: bold;
        border-radius: 8px;
        cursor: pointer;
        box-shadow: 0 3px #b35b10;
    }
    .btn-parent-load:active {
        transform: translateY(2px);
        box-shadow: 0 1px #b35b10;
    }

    /* Scoreboard Headers */
    .game-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
    }

    .badge {
        padding: 8px 16px;
        border-radius: 12px;
        font-weight: bold;
        font-size: 1.1rem;
        background-color: #f1f2f6;
    }
    .q-badge { background-color: #a29bfe; color: white; }
    .score-badge { background-color: #fdcb6e; color: #2c3e50; }
    
    .child-greeting {
        font-size: 1.6rem;
        color: var(--accent-teal);
        font-weight: bold;
        margin-bottom: 15px;
    }

    /* Vertical Math Layout Framework */
    .worksheet-grid {
        display: grid;
        grid-template-columns: 80px 120px auto;
        align-items: center;
        max-width: 780px;
        margin: 0 auto 25px auto;
    }

    .column-math-stack {
        grid-column: 1 / span 2;
        display: grid;
        grid-template-columns: 60px 140px;
        align-items: center;
        row-gap: 15px;
    }

    .math-sign {
        font-size: 4rem;
        font-weight: bold;
        color: #7f8c8d;
        text-align: center;
    }

    .big-number {
        font-size: 5.5rem;
        font-weight: bold;
        color: var(--text-color);
        text-align: center;
        background: #f1f2f6;
        border-radius: 16px;
        padding: 5px 15px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        margin-right: 20px;
    }

    /* Division Sandbox Layout */
    .sandbox-box {
        grid-column: 3;
        grid-row: 1 / span 2;
        background-color: var(--sandbox-bg);
        border: 4px solid var(--accent-teal);
        border-radius: 20px;
        padding: 15px;
        height: 100%;
        min-height: 280px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        box-shadow: 0 6px 12px rgba(0,0,0,0.05);
    }

    /* Supply Pile Component */
    .supply-pile-section {
        background-color: var(--supply-bg);
        border: 2px solid #bdc3c7;
        border-radius: 12px;
        padding: 10px;
        margin-bottom: 15px;
        text-align: center;
    }
    
    .supply-title {
        font-size: 0.85rem;
        font-weight: bold;
        text-transform: uppercase;
        color: #7f8c8d;
        margin-bottom: 5px;
        letter-spacing: 0.5px;
    }

    .supply-canvas {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
        min-height: 40px;
    }

    /* Baskets Container */
    .baskets-grid {
        flex-grow: 1;
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        justify-content: center;
        align-content: center;
        margin-bottom: 15px;
    }

    .group-basket {
        background-color: var(--basket-bg);
        border: 3px dashed #16a085;
        border-radius: 16px;
        padding: 10px;
        min-width: 100px;
        min-height: 100px;
        display: flex;
        flex-wrap: wrap;
        align-content: center;
        justify-content: center;
        gap: 6px;
        position: relative;
        box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
    }

    .basket-label {
        position: absolute;
        bottom: -3px;
        right: 5px;
        font-size: 0.75rem;
        font-weight: bold;
        color: #bdc3c7;
    }

    .sandbox-emoji {
        font-size: 2rem;
        user-select: none;
        animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    }

    @keyframes popIn {
        0% { transform: scale(0); }
        100% { transform: scale(1); }
    }

    .sandbox-controls {
        display: flex;
        justify-content: center;
        gap: 12px;
    }

    .btn-action {
        border: none;
        color: white;
        font-size: 0.95rem;
        font-weight: bold;
        padding: 10px 18px;
        border-radius: 50px;
        cursor: pointer;
        transition: transform 0.1s ease, box-shadow 0.1s ease;
        white-space: nowrap;
    }
    .btn-add { background-color: var(--accent-teal); box-shadow: 0 4px #117a65; }
    .btn-reset { background-color: var(--accent-red); box-shadow: 0 4px #c0392b; }
    .btn-action:active { transform: translateY(3px); box-shadow: 0 1px transparent; }

    /* Worksheet Underline Separator Bar Line */
    .worksheet-line {
        grid-column: 1 / span 3;
        height: 6px;
        background-color: var(--text-color);
        border-radius: 3px;
        margin: 20px 0;
    }

    /* Bottom Row Answer Container */
    .answer-row-wrapper {
        grid-column: 1 / span 3;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        padding-left: 60px;
        gap: 25px;
    }

    .input-label {
        font-size: 1.3rem;
        font-weight: bold;
        color: var(--text-color);
    }

    .input-box {
        width: 100px;
        height: 65px;
        font-size: 2.5rem;
        text-align: center;
        border: 3px solid var(--accent-teal);
        border-radius: 12px;
        color: var(--text-color);
        outline: none;
    }
    .btn-submit {
        background-color: var(--accent-teal);
        box-shadow: 0 5px #117a65;
        font-size: 1.3rem;
        padding: 14px 30px;
        border-radius: 50px;
    }

    /* Success Modals */
    .modal-screen {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        display: none;
        justify-content: center;
        align-items: center;
        z-index: 100;
    }
    .modal-card {
        background: white;
        padding: 40px;
        border-radius: 24px;
        text-align: center;
        width: 90%;
        max-width: 400px;
    }
    .modal-card h2 { font-size: 2.2rem; color: var(--accent-green); margin-bottom: 10px; }
    .modal-card p { font-size: 1.2rem; margin-bottom: 20px; }

    /* Responsive Adjustments */
    @media (max-width: 768px) {
        body {
            padding: 100px 10px 20px 10px;
        }

        .game-window {
            padding: 15px;
        }

        .child-greeting {
            font-size: 1.3rem;
        }

        .badge {
            font-size: 0.9rem;
            padding: 6px 10px;
        }

        .worksheet-grid {
            grid-template-columns: 1fr;
            gap: 15px;
        }

        .column-math-stack {
            grid-column: 1;
            grid-template-columns: 50px 1fr;
            justify-items: center;
        }

        .big-number {
            font-size: 3.5rem;
            margin-right: 10px;
        }

        .math-sign {
            font-size: 3rem;
        }

        .sandbox-box {
            grid-column: 1;
            grid-row: auto;
            min-height: 200px;
            padding: 15px;
        }

        .group-basket {
            min-width: 80px;
            min-height: 80px;
        }

        .sandbox-emoji {
            font-size: 1.5rem;
        }

        .answer-row-wrapper {
            padding-left: 0;
            justify-content: center;
            gap: 15px;
        }

        .input-box {
            width: 80px;
            height: 55px;
            font-size: 2rem;
        }

        .btn-submit {
            padding: 10px 20px;
            font-size: 1.1rem;
        }
    }

    @media (max-width: 480px) {
        .parent-settings-row {
            flex-direction: column;
            gap: 10px;
        }

        .emoji-selector {
            order: -1;
        }

        .big-number {
            font-size: 2.5rem;
        }

        .math-sign {
            font-size: 2.5rem;
        }

        .sandbox-controls {
            flex-wrap: wrap;
        }

        .btn-action {
            font-size: 0.85rem;
            padding: 8px 12px;
        }
    }
