/* ========================================
   MONEY SHOP STYLES
   ======================================== */

/* View transition fade */
.mshop-fade-out {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mshop-fade-in {
    animation: mshop-fade-in 0.3s ease;
}

@keyframes mshop-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mshop-activity {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 0;
}

/* Progress & Counter */
.mshop-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 0.5rem;
}

.mshop-progress-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    border: 2px solid rgba(255,255,255,0.6);
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.mshop-progress-dot.current {
    background: #fbbf24;
    border-color: #f59e0b;
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(251,191,36,0.6);
}

.mshop-progress-dot.correct {
    background: #10b981;
    border-color: #059669;
}

.mshop-progress-dot.wrong {
    background: #ef4444;
    border-color: #dc2626;
}

.mshop-progress-dot.skipped {
    background: #94a3b8;
    border-color: #64748b;
    border-style: dashed;
}

.mshop-counter {
    text-align: center;
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.mshop-mode-label {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 0.2rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 6px rgba(99,102,241,0.3);
}

/* ---- Exterior View ---- */
.mshop-exterior-view {
    position: relative;
}

.mshop-exterior-scene {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15), 0 0 0 3px rgba(255,255,255,0.1);
    container-type: inline-size;
}

.mshop-exterior-image {
    width: 100%;
    display: block;
    border-radius: 16px;
}

/* Door clickable hitbox — positioned over the door in the image */
.mshop-door-hitbox {
    position: absolute;
    top: 48.8%;
    left: 37.25%;
    width: 25.5%;
    height: 36.4%;
    cursor: pointer;
    z-index: 3;
    border-radius: 4px;
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

.mshop-door-hitbox:hover {
    box-shadow: 0 0 30px 10px rgba(102, 126, 234, 0.5), inset 0 0 20px 5px rgba(102, 126, 234, 0.15);
    background: rgba(102, 126, 234, 0.08);
}

.mshop-door-hitbox:hover::after {
    content: 'Enter Shop';
    position: absolute;
    bottom: -2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.75);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Door click note */
.mshop-door-note {
    position: absolute;
    bottom: 4%;
    left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    background: #fffde7;
    color: #5d4037;
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    box-shadow: 2px 3px 6px rgba(0,0,0,0.25), 0 0 0 2px #e6c94a;
    z-index: 4;
    white-space: nowrap;
    animation: doorNoteBounce 2s ease-in-out infinite;
    pointer-events: none;
}

.mshop-door-note-arrow {
    font-size: 1.1em;
    margin-right: 0.15rem;
}

@keyframes doorNoteBounce {
    0%, 100% { transform: translateX(-50%) rotate(-2deg) translateY(0); }
    50% { transform: translateX(-50%) rotate(-2deg) translateY(-6px); }
}

/* Speech bubble on exterior — top left */
.mshop-exterior-scene .mshop-speech-overlay {
    top: 4%;
    left: 4%;
    right: auto;
    bottom: auto;
    max-width: 50%;
}

/* Typewriter cursor */
.mshop-typewriter-cursor {
    display: inline;
    font-weight: 400;
    color: #475569;
    animation: mshop-blink 0.6s step-end infinite;
}

@keyframes mshop-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ---- Shop View ---- */
.mshop-shop-view {
    position: relative;
}

.mshop-scene {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15), 0 0 0 3px rgba(255,255,255,0.1);
    container-type: inline-size;
}

.mshop-bg-image {
    width: 100%;
    display: block;
    border-radius: 16px;
}

.mshop-speech-overlay {
    position: absolute;
    top: 4%;
    left: 4%;
    right: auto;
    bottom: auto;
    max-width: 50%;
    z-index: 2;
}

.mshop-speech-overlay .mshop-speech-bubble::before {
    display: none;
}

.mshop-shelf-product {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: none;
    border: none;
    z-index: 1;
}

/* Individual product positions */
.mshop-shelf-product[data-product-id="oranges"] {
    top: 41%;
    left: 30%;
}

.mshop-shelf-product[data-product-id="bread"] {
    bottom: 18%;
    right: -2%;
}

.mshop-shelf-product[data-product-id="bread"] .mshop-product-emoji {
    font-size: 9.82cqw;
}

.mshop-shelf-product[data-product-id="apples"] {
    top: 39%;
    right: 25%;
}

.mshop-shelf-product[data-product-id="juice"] {
    top: 22%;
    right: 30%;
}

.mshop-shelf-product[data-product-id="juice"] .mshop-product-emoji {
    font-size: 6.46cqw;
}

.mshop-shelf-product[data-product-id="cake"] {
    bottom: 17%;
    right: 23%;
}

.mshop-shelf-product[data-product-id="cake"] .mshop-product-emoji {
    font-size: 12.90cqw;
}

/* ---- Bunch (grouped fruit) styling ---- */
.mshop-bunch {
    position: relative;
    display: inline-block;
}

.mshop-bunch-item {
    position: absolute;
    font-size: 4.26cqw;
    transition: all 0.2s ease;
}

.mshop-bunch-item:first-child {
    position: relative;
}

/* Oranges bunch — 5 items, pyramid-ish cluster */
[data-product-id="oranges"] .mshop-bunch-item:nth-child(1) {
    font-size: 3.96cqw;
    transform: rotate(-5deg);
    z-index: 2;
}
[data-product-id="oranges"] .mshop-bunch-item:nth-child(2) {
    font-size: 4.54cqw;
    top: -0.46cqw;
    left: 2.56cqw;
    transform: rotate(8deg);
    z-index: 3;
}
[data-product-id="oranges"] .mshop-bunch-item:nth-child(3) {
    font-size: 3.66cqw;
    top: 0.19cqw;
    left: 5.31cqw;
    transform: rotate(-3deg);
    z-index: 1;
}
[data-product-id="oranges"] .mshop-bunch-item:nth-child(4) {
    font-size: 3.82cqw;
    top: -1.29cqw;
    left: 1.29cqw;
    transform: rotate(4deg);
    z-index: 0;
}
[data-product-id="oranges"] .mshop-bunch-item:nth-child(5) {
    font-size: 3.52cqw;
    top: -1.10cqw;
    left: 4.04cqw;
    transform: rotate(-7deg);
    z-index: 0;
}

/* Apples bunch — 4 items, tighter cluster */
[data-product-id="apples"] .mshop-bunch-item:nth-child(1) {
    font-size: 4.10cqw;
    transform: rotate(4deg);
    z-index: 2;
}
[data-product-id="apples"] .mshop-bunch-item:nth-child(2) {
    font-size: 4.40cqw;
    top: -0.36cqw;
    left: 2.39cqw;
    transform: rotate(-6deg);
    z-index: 3;
}
[data-product-id="apples"] .mshop-bunch-item:nth-child(3) {
    font-size: 3.82cqw;
    top: 2.20cqw;
    left: 0.36cqw;
    transform: rotate(7deg);
    z-index: 1;
}
[data-product-id="apples"] .mshop-bunch-item:nth-child(4) {
    font-size: 4.26cqw;
    top: 2.01cqw;
    left: 2.75cqw;
    transform: rotate(-4deg);
    z-index: 4;
}

.mshop-shelf-product:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

.mshop-shelf-product.target .mshop-product-emoji,
.mshop-shelf-product.target .mshop-bunch {
    animation: pulse-glow 1.5s infinite;
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(102, 126, 234, 0.6)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.9)); transform: scale(1.1); }
}

.mshop-shelf-product.selected {
    transform: scale(1.25);
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.7));
}

.mshop-shelf-product.wrong .mshop-product-emoji,
.mshop-shelf-product.wrong .mshop-bunch {
    animation: shake 0.4s ease-in-out;
}

.mshop-product-emoji {
    font-size: 2.9rem;
    transition: all 0.2s ease;
}

.mshop-product-name {
    font-size: 0.65rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}


.mshop-speech-bubble {
    background: white;
    border-radius: 16px;
    padding: 0.85rem 1.15rem;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    font-size: 1.05rem;
    line-height: 1.4;
    animation: bubble-in 0.3s ease;
}

.mshop-speech-bubble::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 12px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid white;
}

@keyframes bubble-in {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Shopping List */
.mshop-shopping-list {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 3;
    width: 210px;
    background: #fef9e7;
    background-image:
        repeating-linear-gradient(
            transparent,
            transparent 27px,
            #e8d9b8 27px,
            #e8d9b8 28px
        );
    border-radius: 4px 4px 4px 12px;
    padding: 0.8rem 1rem 1rem;
    box-shadow:
        3px 3px 8px rgba(0,0,0,0.25),
        inset 0 0 20px rgba(0,0,0,0.03);
    transform: rotate(-2deg);
    border-left: 3px solid #d4a853;
    font-family: 'Patrick Hand', 'Comic Sans MS', 'Segoe Print', cursive;
}

.mshop-shopping-list::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 12px;
    background: #c9a96e;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.mshop-shopping-list h3 {
    font-size: 1.15rem;
    margin: 0 0 0.5rem;
    color: #6b4c1e;
    text-align: center;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.mshop-shopping-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.mshop-list-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #3e2c0a;
    transition: all 0.3s;
}

.mshop-list-item.purchased {
    opacity: 0.45;
    text-decoration: line-through;
    text-decoration-color: #10b981;
    text-decoration-thickness: 2px;
}

.mshop-list-emoji {
    font-size: 1.1rem;
}

.mshop-list-text {
    flex: 1;
}

.mshop-list-check {
    color: #10b981;
    font-weight: 700;
    font-size: 1rem;
}

/* ---- Payment View ---- */
.mshop-payment-view {
    transition: all 0.3s ease;
}

.mshop-payment-view.correct .mshop-payment-scene {
    box-shadow: 0 0 0 4px #10b981, 0 4px 20px rgba(16,185,129,0.2);
}

/* Counter scene */
.mshop-payment-scene {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15), 0 0 0 3px rgba(255,255,255,0.1);
    margin-bottom: 1rem;
}

.mshop-counter-image {
    width: 100%;
    display: block;
    border-radius: 16px;
}

.mshop-counter-money-overlay {
    position: absolute;
    top: 5%;
    left: 5%;
    width: 90%;
    height: 85%;
    pointer-events: none;
}

/* Back to shop link */
.mshop-back-to-shop {
    position: absolute;
    top: 12px;
    left: 14px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 5;
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.2s ease;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.mshop-back-to-shop:hover {
    opacity: 1;
}

/* Money placed on counter */
.mshop-counter-piece {
    cursor: pointer;
    pointer-events: auto;
    position: absolute;
    transition: filter 0.15s ease, box-shadow 0.15s ease;
}

.mshop-counter-piece.note {
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
}

.mshop-counter-piece.coin {
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.mshop-counter-piece:hover {
    filter: drop-shadow(0 0 4px rgba(255,255,255,0.9)) drop-shadow(0 3px 5px rgba(0,0,0,0.5)) brightness(1.1);
    cursor: grab;
    transform: scale(1.05);
}

.mshop-counter-piece:hover::after {
    content: '✕';
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Wallet tray */
.mshop-wallet-tray {
    background: linear-gradient(135deg, #1e293b, #334155);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.15);
}

.mshop-wallet-label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

/* Payment buttons row */
.mshop-payment-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.mshop-scene-buttons {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    margin-bottom: 0;
}

/* Clear button */
.mshop-clear-btn {
    padding: 0.85rem 1.5rem;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}

.mshop-clear-btn:hover:not(:disabled) {
    transform: scale(1.03);
    box-shadow: 0 6px 16px rgba(239,68,68,0.4);
    background: linear-gradient(135deg, #f87171, #ef4444);
}

.mshop-clear-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.mshop-clear-btn:disabled {
    background: linear-gradient(135deg, #64748b, #475569);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Pay button */
.mshop-pay-btn {
    padding: 0.85rem 2rem;
    flex: 1;
    max-width: 280px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 1.15rem;
    font-weight: 700;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(16,185,129,0.3);
    letter-spacing: 0.02em;
}

.mshop-pay-btn:hover:not(:disabled) {
    transform: scale(1.03);
    box-shadow: 0 6px 16px rgba(16,185,129,0.4);
    background: linear-gradient(135deg, #34d399, #10b981);
}

.mshop-pay-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.mshop-pay-btn:disabled {
    background: linear-gradient(135deg, #64748b, #475569);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Item card (used in register view) */
.mshop-item-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f8fafc;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
}

.mshop-item-card.small {
    padding: 0.6rem 1rem;
    margin-bottom: 0.5rem;
}

.mshop-item-emoji {
    font-size: 2rem;
}

.mshop-item-desc {
    flex: 1;
    font-size: 1.05rem;
    font-weight: 600;
    color: #334155;
}

.mshop-item-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.mshop-item-paid {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
}

/* Shopkeeper row (in register view) */

/* Section headings */
.mshop-money-grid h4 {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 0.5rem;
    font-weight: 600;
}

.mshop-money-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

/* Money Pieces (image-based NZ money) */
.mshop-money-piece {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    user-select: none;
    filter: drop-shadow(0 0 3px rgba(255,255,255,0.8)) drop-shadow(0 2px 3px rgba(0,0,0,0.4));
}

.mshop-money-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    display: block;
}

.mshop-money-piece:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 0 4px rgba(255,255,255,0.9)) drop-shadow(0 3px 5px rgba(0,0,0,0.5));
}

.mshop-money-piece:active {
    transform: scale(0.95);
}

/* Notes */
.mshop-money-piece.note {
    width: 215px;
    height: 108px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

/* Coins */
.mshop-money-piece.coin {
    border-radius: 50%;
    overflow: hidden;
}

.mshop-money-piece.coin-2 {
    width: 102px;
    height: 102px;
}

.mshop-money-piece.coin-1 {
    width: 90px;
    height: 90px;
}

.mshop-money-piece.coin-50 {
    width: 83px;
    height: 83px;
}

.mshop-money-piece.coin-20 {
    width: 74px;
    height: 74px;
}

.mshop-money-piece.coin-10 {
    width: 66px;
    height: 66px;
}

/* Placed Money (register change tray) */
.mshop-placed-money {
    min-height: 70px;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    border: 2px dashed #cbd5e1;
    margin-bottom: 0.75rem;
}

.mshop-placed-empty {
    color: #94a3b8;
    font-size: 0.85rem;
    font-style: italic;
}

.mshop-placed-piece {
    cursor: pointer;
    position: relative;
}

.mshop-placed-piece:hover {
    opacity: 0.7;
}

.mshop-placed-piece:hover .mshop-remove-hint {
    opacity: 1;
}

.mshop-remove-hint {
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.55rem;
    color: #ef4444;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

/* Running Total */
.mshop-total-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.mshop-total-label {
    font-weight: 600;
    color: #475569;
}

.mshop-total-value {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.3rem;
    transition: color 0.2s;
}

.mshop-total-value.overpay {
    color: #ef4444;
}

.mshop-total-target {
    color: #94a3b8;
    font-weight: 500;
}

/* Attempt Dots */
.mshop-attempts {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 1rem;
}

.mshop-attempt-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e2e8f0;
    transition: background 0.3s;
}

.mshop-attempt-dot.used {
    background: #ef4444;
}

/* Feedback */
.mshop-feedback {
    text-align: center;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    animation: bubble-in 0.3s ease;
}

.mshop-feedback.hint {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fbbf24;
}

.mshop-feedback.answer-reveal {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.mshop-feedback.success {
    background: #f0fdf4;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

/* ---- Cash Register View ---- */
.mshop-register-view {
    transition: all 0.3s ease;
}

.mshop-register-view.correct .mshop-register-scene {
    box-shadow: 0 0 0 4px #10b981, 0 4px 20px rgba(16,185,129,0.2);
}

/* Register scene (full-width image container) */
.mshop-register-scene {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15), 0 0 0 3px rgba(255,255,255,0.1);
    margin-bottom: 1rem;
    container-type: inline-size;
}

.mshop-register-scene .mshop-register-image {
    filter: brightness(0.7);
}

.mshop-register-image {
    width: 100%;
    display: block;
    border-radius: 16px;
}

.mshop-register-overlay {
    position: absolute;
    top: 40%;
    left: 3%;
    width: 94%;
    height: 55%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 1fr 1fr 1fr 1fr;
    column-gap: 1px;
    row-gap: 1.6%;
}

.mshop-register-compartment {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    min-height: 0;
}

/* Row 1: notes (auto), Row 2: blank, Row 3: coins, Row 4: 10c */
.mshop-register-compartment:nth-child(n+5):nth-child(-n+8) {
    grid-row: 3;
}

.mshop-register-compartment:nth-child(9) {
    grid-row: 4;
    grid-column: 1;
}

/* Notes in register: rotated 90deg to sit vertically */
.mshop-money-piece.in-register.note {
    width: 24.23cqw;
    height: 12.35cqw;
    transform: rotate(90deg);
    cursor: pointer;
    position: relative;
}

/* Column alignment — notes */

/* Coins in register */
.mshop-money-piece.in-register.coin {
    cursor: pointer;
    position: relative;
}

/* Column alignment — coins match notes above */
.mshop-money-piece.in-register.coin-2 {
    width: 8.78cqw;
    height: 8.78cqw;
}

.mshop-money-piece.in-register.coin-1 {
    width: 7.80cqw;
    height: 7.80cqw;
}

.mshop-money-piece.in-register.coin-50 {
    width: 7.16cqw;
    height: 7.16cqw;
}

.mshop-money-piece.in-register.coin-20 {
    width: 6.50cqw;
    height: 6.50cqw;
}

.mshop-money-piece.in-register.coin-10 {
    width: 5.85cqw;
    height: 5.85cqw;
}

.mshop-money-piece.in-register:hover {
    filter: drop-shadow(0 0 4px rgba(255,255,255,0.9)) drop-shadow(0 3px 5px rgba(0,0,0,0.5)) brightness(1.15);
}

/* Change pieces row (selected change in wallet tray) */
.mshop-change-pieces {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

.mshop-change-tray-piece {
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
}

.mshop-change-tray-piece:hover {
    opacity: 0.75;
    transform: scale(1.05);
}

.mshop-change-tray-piece:hover::after {
    content: '✕';
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.mshop-change-tray-piece.note {
    overflow: hidden;
}

/* ---- Mode Transition Screen ---- */
.mshop-transition {
    text-align: center;
    padding: 3rem 2rem;
}

.mshop-transition-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.mshop-transition h2 {
    font-size: 1.5rem;
    color: #1e293b;
    margin: 0 0 0.5rem;
}

.mshop-transition p {
    color: #64748b;
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.mshop-continue-btn {
    margin-top: 1.5rem;
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.mshop-continue-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

/* ---- End Screen ---- */
.mshop-end-screen {
    text-align: center;
    padding: 2.5rem 2rem;
}

.mshop-score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #818cf8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: white;
}

.mshop-score-circle .score-number {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
}

.mshop-score-circle .score-total {
    font-size: 0.9rem;
    opacity: 0.85;
}

.mshop-end-message {
    font-size: 1.5rem;
    margin: 0 0 1.25rem;
    color: #1e293b;
}

.mshop-results-summary {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 1.25rem;
}

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

.mshop-result-stat .number {
    font-size: 1.75rem;
    font-weight: 700;
}

.mshop-result-stat.correct .number {
    color: #10b981;
}

.mshop-result-stat.wrong .number {
    color: #ef4444;
}

.mshop-result-stat .label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.mshop-breakdown {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.mshop-breakdown-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.mshop-breakdown-label {
    color: #64748b;
    font-weight: 500;
}

.mshop-breakdown-score {
    font-weight: 700;
    color: #334155;
}

.mshop-restart-btn {
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.mshop-restart-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

/* ---- Money Shop Responsive ---- */
@media (max-width: 700px) {
    .mshop-shopping-list {
        width: 145px;
        padding: 0.5rem 0.6rem 0.6rem;
        font-size: 0.78rem;
    }

    .mshop-money-piece.note {
        width: 176px;
        height: 89px;
    }
}

@media (max-width: 500px) {
    .mshop-activity {
        padding: 0.25rem;
    }

    .mshop-wallet-tray {
        padding: 0.75rem;
    }

    .mshop-pay-btn {
        max-width: 100%;
    }

    .mshop-shopping-list {
        width: 125px;
        padding: 0.4rem 0.5rem 0.5rem;
        bottom: 8px;
        left: 8px;
    }

    .mshop-shopping-list h3 {
        font-size: 0.8rem;
    }

    .mshop-list-item {
        font-size: 0.72rem;
    }

    .mshop-register-overlay {
        grid-template-columns: repeat(3, 1fr);
    }

    .mshop-speech-overlay {
        max-width: 65%;
    }

    .mshop-speech-overlay .mshop-speech-bubble {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
}

/* ---- Best Deal Intro (interior background) ---- */
.mshop-deal-continue-hitbox {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

/* ---- Best Deal Selection View ---- */
.mshop-deal-view {
    position: relative;
}

.mshop-scene-dimmed .mshop-bg-image {
    filter: brightness(0.4);
    transition: filter 0.3s;
}

.mshop-deal-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    width: 92%;
    max-width: 700px;
}

.mshop-deal-quantity-badge {
    background: #fffde7;
    color: #5d4037;
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2), 0 0 0 3px #e6c94a;
    text-align: center;
}

.mshop-deal-cards {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.mshop-deal-card {
    background: white;
    border-radius: 20px;
    padding: 1.75rem 1.5rem;
    width: 260px;
    min-height: 200px;
    text-align: center;
    border: 3px solid #e2e8f0;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.mshop-deal-card:hover {
    border-color: #fbbf24;
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.15);
}

.mshop-deal-card.selected {
    border-color: #10b981;
    background: #f0fdf4;
    box-shadow: 0 0 0 4px rgba(16,185,129,0.2), 0 8px 28px rgba(0,0,0,0.1);
    transform: translateY(-4px);
    pointer-events: none;
}

.mshop-deal-card-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.mshop-deal-card-visual {
    font-size: 1.8rem;
    line-height: 1.4;
}

.mshop-deal-more {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
}

.mshop-deal-card-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
}

.mshop-deal-card-note {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #dc2626;
    background: #fef2f2;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

/* Wrong deal feedback on payment view */
.mshop-payment-view.wrong-deal {
    animation: mshop-wrong-deal-flash 0.6s ease;
}

@keyframes mshop-wrong-deal-flash {
    0%, 100% { background: transparent; }
    50% { background: rgba(245, 158, 11, 0.08); }
}

/* Responsive: Deal cards */
@media (max-width: 600px) {
    .mshop-deal-cards {
        flex-direction: column;
        align-items: center;
    }

    .mshop-deal-card {
        width: 100%;
        max-width: 280px;
        min-height: auto;
        padding: 1.25rem 1rem;
    }

    .mshop-deal-quantity-badge {
        font-size: 0.95rem;
        padding: 0.5rem 1.25rem;
    }

    .mshop-deal-overlay {
        gap: 0.75rem;
    }
}

/* ---- Skip Part Button (Try-It Mode) ---- */
.mshop-skip-part-btn {
    position: absolute;
    top: 4%;
    right: 3%;
    background: #fffde7;
    color: #5d4037;
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    box-shadow: 2px 3px 6px rgba(0,0,0,0.25), 0 0 0 2px #e6c94a;
    z-index: 10;
    white-space: nowrap;
    cursor: pointer;
    animation: doorNoteBounce 2s ease-in-out infinite;
    transform-origin: center center;
    transition: background 0.2s, transform 0.15s;
}

.mshop-skip-part-btn:hover {
    background: #fff9c4;
    box-shadow: 2px 3px 8px rgba(0,0,0,0.3), 0 0 0 2px #d4a017;
    animation: none;
    transform: scale(1.05);
}

