/**
 * Game Visual CSS
 * Place Value Display Styling for Singapore Math Games
 */

/* Main Container */
.place-value-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 10px;
    margin: 15px 0;
}

/* Section Labels */
.place-label {
    font-weight: bold;
    font-size: 1rem;
    color: #495057;
    margin-bottom: 10px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hundreds Section */
.hundreds-section {
    display: flex;
    flex-direction: column;
}

.hundred-boxes {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.hundred-box {
    border: 3px solid #6f42c1;
    border-radius: 12px;
    padding: 15px;
    background-color: #e7d4ff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.hundred-box-header {
    font-weight: bold;
    font-size: 1.2rem;
    color: #6f42c1;
    margin-bottom: 8px;
    background-color: white;
    padding: 4px 12px;
    border-radius: 20px;
}

.hundred-box-content {
    font-size: 3rem;
}

/* Tens Section */
.tens-section {
    display: flex;
    flex-direction: column;
}

.ten-boxes {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.ten-box {
    border: 3px solid #0d6efd;
    border-radius: 12px;
    padding: 12px;
    background-color: #cfe2ff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s ease;
}

.ten-box:hover {
    transform: scale(1.05);
}

.ten-box-header {
    font-weight: bold;
    font-size: 1rem;
    color: #0d6efd;
    margin-bottom: 8px;
    background-color: white;
    padding: 4px 10px;
    border-radius: 15px;
}

.ten-box-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 4px;
    padding: 8px;
    background-color: white;
    border-radius: 8px;
}

.grid-icon {
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ones Section */
.ones-section {
    display: flex;
    flex-direction: column;
}

.ones-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 15px;
    background-color: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
}

.loose-icon {
    font-size: 4rem;
    animation: bounceIn 0.5s ease;
}

/* Place Value Summary */
.place-value-summary {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: #198754;
    padding: 12px;
    background-color: #d1e7dd;
    border-radius: 8px;
    margin-top: 10px;
    border: 2px solid #198754;
}

/* Simple Display (fallback) */
.simple-display {
    font-size: 2rem;
    line-height: 1.4;
    padding: 15px;
    text-align: center;
    background-color: #f8f9fa;
    border-radius: 8px;
}

/* Hints */
.filipino-hint {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* Regrouping Hint */
.regrouping-hint {
    background-color: #fff3cd;
    border: 2px solid #ffc107;
    padding: 15px;
    border-radius: 10px;
    animation: pulse 1.5s ease-in-out infinite;
}

.regrouping-highlight {
    background-color: #ffffcc;
    border: 2px dashed #ff6b6b;
    animation: regroupingGlow 1s ease-in-out infinite;
}

/* Animations */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

@keyframes regroupingGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 193, 7, 1);
    }
}

/* Responsive Design - Tablets */
@media (max-width: 768px) {
    .place-value-container {
        padding: 12px;
        gap: 15px;
    }

    .ten-box-grid {
        gap: 3px;
        padding: 6px;
    }

    .grid-icon {
        font-size: 2.6rem;
    }

    .loose-icon {
        font-size: 3.6rem;
    }

    .hundred-box {
        min-width: 100px;
        padding: 12px;
    }

    .hundred-box-content {
        font-size: 2.5rem;
    }

    .place-value-summary {
        font-size: 1.1rem;
    }
}

/* Responsive Design - Mobile */
@media (max-width: 480px) {
    .place-value-container {
        padding: 10px;
        gap: 12px;
    }

    .ten-boxes,
    .hundred-boxes {
        gap: 10px;
    }

    .ten-box {
        padding: 8px;
    }

    .ten-box-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 2px;
        padding: 5px;
    }

    .grid-icon {
        font-size: 2rem;
    }

    .loose-icon {
        font-size: 3rem;
        gap: 5px;
    }

    .hundred-box {
        min-width: 80px;
        padding: 10px;
    }

    .hundred-box-content {
        font-size: 2rem;
    }

    .place-value-summary {
        font-size: 1rem;
        padding: 10px;
    }

    .filipino-hint {
        font-size: 1rem;
        padding: 12px;
    }

    .simple-display {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .place-value-container {
        page-break-inside: avoid;
    }

    .ten-box,
    .hundred-box {
        box-shadow: none;
        border: 2px solid #000;
    }
}

/* Accessibility */
.ten-box:focus,
.hundred-box:focus {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
}

/* ============================================
   GAME WORKSHOP STYLES (All Games)
   ============================================ */

.game-workshop {
    border-width: 3px;
    border-radius: 12px;
    overflow: hidden;
    animation: workshopAppear 0.5s ease;
}

@keyframes workshopAppear {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.workshop-input-group input {
    border-width: 3px;
}

/* ============================================
   GAME 2: Mental Math Items
   ============================================ */

.mental-math-item {
    transition: transform 0.2s ease;
    animation: itemSlideIn 0.4s ease;
}

.mental-math-item:hover {
    transform: translateX(5px);
}

@keyframes itemSlideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============================================
   GAME 3: Regrouping Workspace
   ============================================ */

.ones-collection {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 15px;
    background-color: #fff3cd;
    border: 2px dashed #ffc107;
    border-radius: 10px;
    min-height: 60px;
}

.ones-workspace-icon {
    font-size: 4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    background-color: white;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.regroup-btn {
    font-size: 1.2rem;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
    transition: all 0.3s ease;
}

.regroup-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(255, 193, 7, 0.6);
}

.regroup-btn-pulse {
    animation: regroupBtnPulse 1.5s ease-in-out infinite;
}

@keyframes regroupBtnPulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4); }
    50% { box-shadow: 0 4px 20px rgba(255, 193, 7, 0.8); transform: scale(1.03); }
}

.new-ten-created {
    border-color: #198754 !important;
    background-color: #d1e7dd !important;
    animation: newTenAppear 0.6s ease;
}

@keyframes newTenAppear {
    0% { transform: scale(0) rotate(-10deg); opacity: 0; }
    60% { transform: scale(1.1) rotate(2deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.remaining-ones {
    min-height: 50px;
    padding: 10px;
}

.answer-unlocked {
    border-color: #198754 !important;
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25) !important;
    animation: answerUnlock 0.5s ease;
}

@keyframes answerUnlock {
    0% { border-color: #dc3545; }
    50% { border-color: #ffc107; }
    100% { border-color: #198754; }
}

/* ============================================
   GAME 4: Column Addition
   ============================================ */

.column-table th,
.column-table td {
    vertical-align: middle;
    padding: 10px 15px;
}

.step-card {
    transition: all 0.3s ease;
    background-color: #fff;
}

.step-card.step-locked {
    opacity: 0.5;
    pointer-events: none;
    background-color: #f8f9fa;
}

.step-input {
    border-width: 2px;
    border-color: #dee2e6;
    transition: border-color 0.3s ease;
}

.step-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.carry-section {
    animation: carryAppear 0.3s ease;
}

@keyframes carryAppear {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-check {
    font-size: 2.6rem;
    min-width: 50px;
}

/* ============================================
   RESPONSIVE: Game Workshops
   ============================================ */

@media (max-width: 768px) {
    .ones-workspace-icon {
        font-size: 3.2rem;
        width: 38px;
        height: 38px;
    }

    .regroup-btn {
        font-size: 1rem;
        padding: 10px 20px;
    }

    .column-table th,
    .column-table td {
        padding: 6px 8px;
        font-size: 0.9rem;
    }

    .step-input {
        width: 65px !important;
        font-size: 1.1rem !important;
    }

    .mental-math-item .item-icon {
        font-size: 2rem !important;
    }
}

@media (max-width: 480px) {
    .ones-workspace-icon {
        font-size: 2.6rem;
        width: 32px;
        height: 32px;
    }

    .ones-collection {
        gap: 5px;
        padding: 10px;
    }

    .regroup-btn {
        font-size: 0.9rem;
        padding: 8px 16px;
        width: 100%;
    }

    .workshop-input-group input {
        font-size: 1.5rem !important;
    }
}

/* Dark Mode Support (if implemented) */
@media (prefers-color-scheme: dark) {
    .place-value-container {
        background-color: #2d3748;
    }

    .ten-box {
        background-color: #4a5568;
        border-color: #5a9fd4;
    }

    .hundred-box {
        background-color: #4a5568;
        border-color: #9f7aea;
    }

    .ones-display {
        background-color: #4a5568;
        border-color: #ecc94b;
    }

    .place-value-summary {
        background-color: #2f855a;
        color: #f0fff4;
    }
}

/* ============================================================
   UPDATED VISUAL STYLES FOR NEW GAMES
   Based on Client PDF Requirements
   ============================================================ */

/* ============================================================
   GAME 1: BLOCKS GAME - Geometric Block Shapes
   Pure CSS blocks with client-specified colors
   ============================================================ */

.block-display {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    align-items: flex-end;
    padding: 40px;
    padding-bottom: 50px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    margin: 20px 0;
}

.place-value-block-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
    justify-content: center;
    padding: 15px;
    background: rgba(255,255,255,0.5);
    border-radius: 12px;
    border: 2px dashed rgba(0,0,0,0.1);
    position: relative;
}

.place-value-block-group .block-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 2px 12px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 0.85rem;
    white-space: nowrap;
}

.place-value-block {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.place-value-block:hover {
    transform: scale(1.05);
}

/* Thousands Block - Isometric Cube with Colored 10x10 Grids */
.block-thousands {
    width: 150px;
    height: 160px;
    position: relative;
    margin-top: 20px;
    margin-right: 20px;
}

/* Front face - 10x10 colored checkerboard grid */
.block-thousands-front {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100px;
    height: 100px;
    border: 2px solid #5a2058;
    background-color: #8B4789;
    background-image:
        /* Colored cell pattern - alternating shades */
        repeating-linear-gradient(
            0deg,
            #9B57A0 0px, #9B57A0 9px,
            #5a2058 9px, #5a2058 10px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.15) 0px, rgba(255, 255, 255, 0.15) 9px,
            #5a2058 9px, #5a2058 10px
        );
    background-blend-mode: multiply, normal;
    background-size: 10px 10px;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.15);
}

/* Checkerboard overlay for front face */
.block-thousands-front::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-conic-gradient(
            rgba(200, 130, 200, 0.35) 0% 25%,
            rgba(139, 71, 137, 0.35) 0% 50%
        );
    background-size: 20px 20px;
    mix-blend-mode: overlay;
}

/* Top face - parallelogram with colored grid */
.block-thousands-top {
    position: absolute;
    bottom: 100px;
    left: 0;
    width: 100px;
    height: 50px;
    border: 2px solid #5a2058;
    background-color: #c080c5;
    transform: skewX(-45deg);
    transform-origin: bottom left;
    background-image:
        repeating-linear-gradient(
            0deg,
            #d09cd5 0px, #d09cd5 4px,
            #7a3a78 4px, #7a3a78 5px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.15) 0px, rgba(255, 255, 255, 0.15) 9px,
            #7a3a78 9px, #7a3a78 10px
        );
    background-blend-mode: multiply, normal;
    background-size: 10px 5px;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1);
}

/* Checkerboard overlay for top face */
.block-thousands-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-conic-gradient(
            rgba(220, 170, 225, 0.3) 0% 25%,
            rgba(180, 100, 185, 0.3) 0% 50%
        );
    background-size: 20px 10px;
    mix-blend-mode: overlay;
}

/* Right face - parallelogram with colored grid */
.block-thousands-right {
    position: absolute;
    bottom: 0;
    left: 100px;
    width: 50px;
    height: 100px;
    border: 2px solid #5a2058;
    background-color: #6b3869;
    transform: skewY(-45deg);
    transform-origin: top left;
    background-image:
        repeating-linear-gradient(
            0deg,
            #7b4879 0px, #7b4879 9px,
            #4a1848 9px, #4a1848 10px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.1) 0px, rgba(255, 255, 255, 0.1) 4px,
            #4a1848 4px, #4a1848 5px
        );
    background-blend-mode: multiply, normal;
    background-size: 5px 10px;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.2);
}

/* Checkerboard overlay for right face */
.block-thousands-right::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-conic-gradient(
            rgba(140, 80, 140, 0.3) 0% 25%,
            rgba(90, 40, 90, 0.3) 0% 50%
        );
    background-size: 10px 20px;
    mix-blend-mode: overlay;
}

/* Ten-Thousands Block - Tall Isometric Tower (10 thousand-cubes stacked) */
.block-ten-thousands {
    width: 185px;
    height: 300px;
    position: relative;
    margin-top: 20px;
    margin-right: 20px;
}

/* Front face - tall rectangle with horizontal segment lines */
.block-ten-thousands-front {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100px;
    height: 220px;
    border: 2px solid #3D0054;
    background-color: #7B1FA2;
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.07) 0px, rgba(255, 255, 255, 0.07) 21px,
            rgba(61, 0, 84, 0.55) 21px, rgba(61, 0, 84, 0.55) 22px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.12) 0px, rgba(255, 255, 255, 0.12) 9px,
            rgba(61, 0, 84, 0.3) 9px, rgba(61, 0, 84, 0.3) 10px
        );
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.block-ten-thousands-front::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: repeating-conic-gradient(
        rgba(200, 100, 220, 0.22) 0% 25%,
        rgba(140, 50, 165, 0.22) 0% 50%
    );
    background-size: 20px 22px;
    mix-blend-mode: overlay;
}

/* Top face - same proportion as thousands */
.block-ten-thousands-top {
    position: absolute;
    bottom: 220px;
    left: 0;
    width: 100px;
    height: 50px;
    border: 2px solid #3D0054;
    background-color: #CE93D8;
    transform: skewX(-45deg);
    transform-origin: bottom left;
    background-image:
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.15) 0px, rgba(255, 255, 255, 0.15) 9px,
            rgba(80, 0, 100, 0.3) 9px, rgba(80, 0, 100, 0.3) 10px
        );
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1);
}

/* Right face - tall parallelogram */
.block-ten-thousands-right {
    position: absolute;
    bottom: 0;
    left: 100px;
    width: 50px;
    height: 220px;
    border: 2px solid #3D0054;
    background-color: #6A1B9A;
    transform: skewY(-45deg);
    transform-origin: top left;
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.05) 0px, rgba(255, 255, 255, 0.05) 21px,
            rgba(40, 0, 60, 0.45) 21px, rgba(40, 0, 60, 0.45) 22px
        );
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.25);
}

/* Hundreds Block - Teal Flat Square */
.block-hundreds {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #26A69A 0%, #4DB6AC 100%);
    border-radius: 10px;
    box-shadow:
        5px 5px 0 rgba(38, 166, 154, 0.3),
        inset -2px -2px 8px rgba(0, 0, 0, 0.2),
        inset 2px 2px 8px rgba(255, 255, 255, 0.3);
    position: relative;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(10, 1fr);
    gap: 1px;
    padding: 2px;
}

.block-hundreds::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.1) 0px,
        transparent 1px,
        transparent 10px
    ),
    repeating-linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.1) 0px,
        transparent 1px,
        transparent 10px
    );
    border-radius: 10px;
}

/* Tens Block - Yellow/Lime Vertical Rod */
.block-tens {
    width: 30px;
    height: 100px;
    background: linear-gradient(135deg, #CDDC39 0%, #D4E157 100%);
    border-radius: 8px;
    box-shadow:
        3px 3px 0 rgba(205, 220, 57, 0.3),
        inset -2px -2px 6px rgba(0, 0, 0, 0.15),
        inset 2px 2px 6px rgba(255, 255, 255, 0.4);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 5px;
}

.block-tens::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.2) 0px,
        transparent 2px,
        transparent 10px
    );
    border-radius: 8px;
}

/* Ones Block - Small Light Blue Cube */
.block-ones {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #4FC3F7 0%, #81D4FA 100%);
    border-radius: 6px;
    box-shadow:
        2px 2px 0 rgba(79, 195, 247, 0.3),
        inset -1px -1px 4px rgba(0, 0, 0, 0.2),
        inset 1px 1px 4px rgba(255, 255, 255, 0.5);
}

/* Block Labels */
.block-label {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    background: white;
    padding: 5px 10px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Block Option Preview - consistent centering for all block sizes */
.block-option-preview {
    width: 100%;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
}

/* Scale down blocks to fit uniformly inside preview area */
.block-option-preview .block-thousands {
    transform-origin: center center;
}

.block-option-preview .block-ten-thousands {
    transform: scale(0.22);
    transform-origin: center center;
}

.block-option-preview .block-hundreds {
    transform: scale(0.6);
    transform-origin: center center;
}

.block-option-preview .block-tens {
    transform: scale(0.7);
    transform-origin: center center;
}

.block-option-preview .block-ones {
    transform: scale(1);
    transform-origin: center center;
}

/* ============================================================
   IDENTIFICATION QUIZ OPTIONS
   ============================================================ */

.identification-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.place-value-option {
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.place-value-option:hover {
    border-color: #4FC3F7;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(79, 195, 247, 0.3);
}

.place-value-option.selected {
    border-color: #2196F3;
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
}

.place-value-option input[type="checkbox"],
.place-value-option input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.5);
}

/* ============================================================
   STEP-BY-STEP BREAKDOWN DISPLAY
   For Games 2, 3, 4 - showing each place value addition
   ============================================================ */

.step-breakdown-container {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.step-breakdown-step {
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    border-left: 5px solid #4FC3F7;
    border-radius: 10px;
    padding: 20px;
    margin: 15px 0;
    transition: all 0.3s ease;
}

.step-breakdown-step:hover {
    transform: translateX(5px);
    border-left-color: #2196F3;
}

.step-number {
    display: inline-block;
    background: #4FC3F7;
    color: white;
    width: 35px;
    height: 35px;
    line-height: 35px;
    border-radius: 50%;
    text-align: center;
    font-weight: bold;
    margin-right: 15px;
}

.step-equation {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin: 10px 0;
}

.running-total-badge {
    display: inline-block;
    background: #FFF3E0;
    border: 2px solid #FFB74D;
    color: #E65100;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    margin-top: 10px;
}

/* ============================================================
   TRADING/REGROUPING ANIMATIONS
   Game 3 - Visual "exchange" system
   ============================================================ */

.trading-container {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    border: 3px dashed #FF9800;
    border-radius: 20px;
    padding: 30px;
    margin: 20px 0;
    text-align: center;
}

.trading-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.trading-from,
.trading-to {
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.trading-arrow {
    font-size: 48px;
    color: #FF9800;
    animation: pulse-arrow 1.5s ease-in-out infinite;
}

@keyframes pulse-arrow {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.trading-text {
    font-size: 20px;
    font-weight: 700;
    color: #E65100;
    margin: 15px 0;
    padding: 15px;
    background: white;
    border-radius: 10px;
}

.items-to-trade {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 10px 0;
}

.item-trading {
    animation: gather-items 1s ease-out forwards;
}

@keyframes gather-items {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-20px) scale(0.8);
        opacity: 0.5;
    }
    100% {
        transform: translateY(0) scale(0);
        opacity: 0;
    }
}

.new-traded-item {
    animation: appear-traded 1s ease-out forwards;
    animation-delay: 1s;
}

@keyframes appear-traded {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================================
   MANGO THEME VISUALS (Game 2)
   ============================================================ */

.mango-display {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
    border-radius: 20px;
    padding: 30px;
    margin: 20px 0;
}

.mango-place-value-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 15px 0;
    padding: 15px;
    background: white;
    border-radius: 15px;
}

.mango-icon-large {
    font-size: 48px;
}

.mango-count {
    font-size: 24px;
    font-weight: 600;
    color: #F57C00;
}

/* ============================================================
   PLACE VALUE READING (Game 4 Easy)
   ============================================================ */

.place-value-chart {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.pv-column {
    text-align: center;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
}

.pv-column-header {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    text-transform: uppercase;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 3px solid currentColor;
}

.pv-column.thousands .pv-column-header {
    color: #8B4789;
    border-bottom-color: #8B4789;
}

.pv-column.hundreds .pv-column-header {
    color: #26A69A;
    border-bottom-color: #26A69A;
}

.pv-column.tens .pv-column-header {
    color: #CDDC39;
    border-bottom-color: #CDDC39;
}

.pv-column.ones .pv-column-header {
    color: #4FC3F7;
    border-bottom-color: #4FC3F7;
}

.pv-items-container {
    min-height: 100px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   FILIPINO PESO VISUALS (Game 4)
   ============================================================ */

.peso-bill {
    width: 80px;
    height: 40px;
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    margin: 5px;
}

.peso-bill.thousands {
    background: linear-gradient(135deg, #E91E63 0%, #F06292 100%);
}

.peso-bill.hundreds {
    background: linear-gradient(135deg, #9C27B0 0%, #BA68C8 100%);
}

.peso-coin {
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, #FFD54F 0%, #FFC107 100%);
    border-radius: 50%;
    border: 3px solid #FFA000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: #E65100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    margin: 3px;
}

/* ============================================================
   RESPONSIVE DESIGN - NEW GAMES
   ============================================================ */

@media (max-width: 768px) {
    .block-display {
        gap: 20px;
        padding: 20px;
    }

    .block-thousands {
        width: 110px;
        height: 130px;
    }

    .block-thousands-front {
        width: 80px !important;
        height: 80px !important;
    }

    .block-thousands-top {
        bottom: 80px !important;
        width: 80px !important;
        height: 40px !important;
    }

    .block-thousands-right {
        left: 80px !important;
        width: 40px !important;
        height: 80px !important;
    }

    .block-ten-thousands {
        width: 140px;
        height: 230px;
    }

    .block-ten-thousands-front {
        width: 80px !important;
        height: 165px !important;
    }

    .block-ten-thousands-top {
        bottom: 165px !important;
        width: 80px !important;
        height: 40px !important;
    }

    .block-ten-thousands-right {
        left: 80px !important;
        width: 40px !important;
        height: 165px !important;
    }

    .block-hundreds {
        width: 70px;
        height: 70px;
    }

    .block-tens {
        width: 25px;
        height: 70px;
    }

    .place-value-block-group {
        gap: 5px;
        padding: 10px;
    }

    .place-value-chart {
        grid-template-columns: repeat(2, 1fr);
    }

    .step-equation {
        font-size: 18px;
    }
}

/* ============================================================
   MARKET THEME (Games 2-4 Subtraction)
   ============================================================ */

.market-display {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
    border-radius: 20px;
    padding: 30px;
    margin: 20px 0;
}

/* Icons marked for removal (subtraction) */
.icon-removed {
    opacity: 0.4;
    text-decoration: line-through;
    filter: grayscale(60%);
}

.icon-removed-group {
    opacity: 0.5;
}

/* ============================================================
   BORROWING / DECOMPOSITION STYLES (Game 3 & 4)
   Reverse of trading: breaking apart visuals
   ============================================================ */

.decompose-container {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    border: 3px dashed #E65100;
    border-radius: 20px;
    padding: 30px;
    margin: 20px 0;
    text-align: center;
}

.borrowing-decompose-box {
    animation: borrowHighlight 1s ease-in-out;
}

@keyframes borrowHighlight {
    0% { background-color: #FFCCBC; }
    50% { background-color: #FF8A65; }
    100% { background-color: #FFE0B2; }
}

.item-to-decompose {
    display: inline-block;
    transition: all 0.6s ease;
}

.items-decomposed {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}

.item-decomposed {
    display: inline-block;
    transition: all 0.3s ease;
}

/* Borrowing highlight for step that needs borrowing */
.borrowing-highlight {
    background-color: #FFF3E0;
    border: 2px dashed #E65100;
    animation: borrowGlow 1s ease-in-out infinite;
}

@keyframes borrowGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(230, 81, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(230, 81, 0, 0.7);
    }
}

/* Break apart animation */
@keyframes break-apart {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3) rotate(10deg);
        opacity: 0.5;
    }
    100% {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
}

/* Appear from decomposition */
@keyframes appear-decomposed {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    60% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Currency note styling */
.baht-note {
    width: 80px;
    height: 40px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    margin: 5px;
}

.baht-note.thousands {
    background: linear-gradient(135deg, #6A1B9A 0%, #8E24AA 100%);
}

.baht-note.hundreds {
    background: linear-gradient(135deg, #C62828 0%, #E53935 100%);
}

.baht-coin {
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, #FFD54F 0%, #FFC107 100%);
    border-radius: 50%;
    border: 3px solid #FFA000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: #E65100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    margin: 3px;
}
