/* ========================================================================== */
/* MODULE 4 STYLES: GAMEPLAY & LEVEL ENGINE (css/level.css)                   */
/* Senior Game Developer Architecture Standard - Smooth Vector 3D Typography   */
/* ========================================================================== */

.gameplay-screen {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: env(safe-area-inset-top, 12px) 12px calc(env(safe-area-inset-bottom, 12px) + 12px) 12px;
    box-sizing: border-box;
    z-index: 10;
    overflow: hidden;
    background-color: #1b132b;
    transition: opacity 0.1s ease;
}

/* Dynamic Gameplay Background with smooth blur & radial glow */
.gameplay-screen::before {
    content: '';
    position: absolute;
    inset: -16px;
    background-image: var(--gameplay-bg-url, url('../game_img_assets/game_bg_assets/game_bg(1).webp'));
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(2.5px) brightness(0.92);
    z-index: 1;
}

.gameplay-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* -------------------------------------------------------------------------- */
/* GAMEPLAY HEADER NAVIGATION BAR                                             */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* GAMEPLAY HEADER NAVIGATION BAR                                             */
/* -------------------------------------------------------------------------- */
.gameplay-header {
    position: relative;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    background: transparent;
    border-bottom: none;
    box-shadow: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    gap: 6px;
    z-index: 25;
    box-sizing: border-box;
}

.gameplay-header::before {
    display: none;
}

/* Pause Button matching 3D Blue Circle Settings Gear */
.gameplay-pause-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(180deg, #52c4ff 0%, #1a94ff 100%);
    box-shadow: 0 4px 0 #0f6bbd, 0 6px 10px rgba(0,0,0,0.3), inset 0 2px 2px rgba(255,255,255,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.1s ease;
    flex-shrink: 0;
}

.gameplay-pause-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 55%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.08) 70%, rgba(255, 255, 255, 0) 100%);
    border-radius: 50% 50% 40% 40%;
    pointer-events: none;
}

.gameplay-pause-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #0f6bbd;
}

.gameplay-pause-btn i {
    color: #ffffff;
    font-size: 18px;
    z-index: 5;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Center Level Title Pill Badge */
.gameplay-title-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.gameplay-level-badge {
    background: linear-gradient(180deg, #ffee75 0%, #ffc107 100%);
    border: 2px solid #ffffff;
    border-radius: 18px;
    padding: 4px 14px;
    box-shadow: 0 3.5px 0 #d99b00, 0 5px 8px rgba(0,0,0,0.35);
    color: #ffffff;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.3px;
    -webkit-text-stroke: 2px #2a2a2a;
    paint-order: stroke fill;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    white-space: nowrap;
}

/* Side-by-Side Status Pills Container */
.header-status-pills {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Cream-Colored 3D Pill Base matching Reference Image (ENLARGED) */
.status-pill {
    position: relative;
    height: 34px;
    background: linear-gradient(180deg, #fffaf0 0%, #ffe8be 100%);
    border: 2px solid #ffffff;
    border-radius: 17px;
    padding-left: 30px;
    padding-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 0 #d6982b, 0 5px 10px rgba(0, 0, 0, 0.35), inset 0 2px 2px rgba(255, 255, 255, 0.9);
    box-sizing: border-box;
}

.heart-badge-wrapper,
.coin-badge-wrapper {
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
}

.status-heart-img,
.status-coin-img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.45));
}

.lives-num-badge {
    position: absolute;
    top: 48%;
    left: 44%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 900;
    -webkit-text-stroke: 1.5px #a61212;
    paint-order: stroke fill;
    text-shadow: 0 1.5px 3px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.heart-add-btn,
.coin-add-btn {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: linear-gradient(180deg, #32d74b 0%, #24b33b 100%);
    border: 1.5px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    color: #ffffff;
    font-size: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 5;
}

.status-pill-val {
    font-size: 15px;
    font-weight: 900;
    color: #83103c;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
    white-space: nowrap;
}

.coin-pill .status-pill-val {
    color: #7a4600;
}

/* -------------------------------------------------------------------------- */
/* QUESTION MARK BADGES ROW (?)                                               */
/* -------------------------------------------------------------------------- */
.question-badges-row {
    width: auto;
    max-width: 380px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 12px;
    margin: 6px auto 0 auto;
    z-index: 20;
    max-height: 72px; /* Guaranteed MAX 2 ROWS */
    background: rgba(45, 20, 8, 0.55);
    backdrop-filter: blur(6px);
    border-radius: 16px;
    border: 1.5px solid rgba(255, 200, 140, 0.25);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.q-badge {
    width: 34px;
    height: 34px;
    background: linear-gradient(180deg, #ff9a44 0%, #fc6c21 100%);
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 3px 0 #c44a0e, 0 4px 8px rgba(0,0,0,0.3), inset 0 2px 2px rgba(255,255,255,0.7);
    color: #ffffff;
    font-family: 'Fredoka One', cursive;
    font-size: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s ease;
}

/* Medium compact sizing for 8 - 12 badges */
.question-badges-row.compact-medium {
    gap: 4px;
}
.question-badges-row.compact-medium .q-badge {
    width: 27px;
    height: 27px;
    font-size: 14px;
    border-width: 1.5px;
    box-shadow: 0 2.5px 0 #c44a0e, 0 3px 6px rgba(0,0,0,0.3);
}

/* Super compact sizing for 13+ badges */
.question-badges-row.compact-small {
    gap: 3px;
}
.question-badges-row.compact-small .q-badge {
    width: 22px;
    height: 22px;
    font-size: 11px;
    border-width: 1.5px;
    box-shadow: 0 2px 0 #c44a0e, 0 2px 4px rgba(0,0,0,0.3);
}

.q-badge.found {
    background: linear-gradient(180deg, #7bed2f 0%, #26c014 100%);
    box-shadow: 0 3px 0 #1a850e, 0 4px 8px rgba(0,0,0,0.25);
    transform: scale(1.1);
}

.q-badge.found i {
    font-size: 16px;
    text-shadow: 0 2px 3px rgba(0,0,0,0.3);
}

.question-badges-row.compact-small .q-badge.found i {
    font-size: 11px;
}

/* -------------------------------------------------------------------------- */
/* DUAL CANVAS CONTAINER & PINCH/PAN ZOOMABLE CARDS                           */
/* -------------------------------------------------------------------------- */
.diff-canvas-container {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 6px 0; /* Gives 6px breathing room so top and bottom white frame border strokes are 100% visible */
    z-index: 20;
    overflow: visible;
    touch-action: none; /* Prevents native browser scroll interfering with pinch & drag */
}

.img-card-wrapper {
    position: relative;
    width: 100%;
    max-width: min(88vw, 420px);
    background: #ffffff;
    overflow: visible; /* Allows green markers at image edges to draw full unclipped 360° circles! */
    box-shadow: 0 10px 24px rgba(0,0,0,0.45);
    touch-action: none;
}

/* Dedicated Canvas Clip Viewport with Crisp 3.5px Solid White Border Frame */
.canvas-viewport {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Cleanly clips zoomed canvas image AND markers */
    border: none;
    box-shadow: inset 0 0 0 3.5px #ffffff; /* Crisp white border frame without shrinking inner coordinate box */
    box-sizing: border-box;
    contain: layout paint;
}

.canvas-transform-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform-origin: center center;
    transition: none;
}

.canvas-transform-layer.is-transforming {
    will-change: transform;
    backface-visibility: hidden;
}

/* Zoomable Canvas Element with Hardware Acceleration */
.diff-image {
    width: 100%;
    height: 100%;
    object-fit: fill; /* Fits exact 100% image boundaries from top to bottom with 0% cropping */
    display: block;
    cursor: grab;
    transition: none; /* Instant 0ms touch drag response without rubbery delay */
}

.diff-image:active {
    cursor: grabbing;
}

.found-marker {
    position: absolute;
    width: var(--marker-size, 38px);
    height: var(--marker-size, 38px);
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
    border: 3.5px solid #7bed2f;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 12px #7bed2f, inset 0 0 8px #7bed2f;
    pointer-events: none;
    z-index: 15;
    will-change: transform, opacity;
    backface-visibility: hidden;
    animation: markerPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes markerPop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    70% { transform: translate(-50%, -50%) scale(1.3); }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.hint-pulse-marker {
    position: absolute;
    width: var(--marker-size, 48px);
    height: var(--marker-size, 48px);
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
    border: 3.5px dashed #ffea4c;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 16px #ffea4c;
    pointer-events: none;
    will-change: transform, opacity;
    backface-visibility: hidden;
    animation: hintPulseLoop 1.2s infinite ease-in-out;
    z-index: 16;
}

@keyframes hintPulseLoop {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    50% { transform: translate(-50%, -50%) scale(1.35); opacity: 0.3; }
}

/* Tutorial-style hand shown with a paid hint. Its wrapper is positioned at the
   exact JSON point; the transform aligns hand.png's fingertip to that point. */
.hint-hand-pointer {
    position: absolute;
    width: clamp(50px, 15vw, 64px);
    height: clamp(50px, 15vw, 64px);
    transform: translate(-25%, -16.6667%);
    pointer-events: none;
    z-index: 48;
    will-change: left, top;
}

.hint-hand-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.65));
    animation: hintHandTapBounce 1.2s infinite ease-in-out;
}

@keyframes hintHandTapBounce {
    0%, 100% { transform: scale(1) translate(0, 0); }
    50% { transform: scale(0.80) translate(-6px, -6px); }
}

.error-ripple {
    position: absolute;
    width: 32px;
    height: 32px;
    border: 3px solid #ff5252;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    will-change: transform, opacity;
    backface-visibility: hidden;
    animation: errorRipple 0.5s ease-out forwards;
}

@keyframes errorRipple {
    0% { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}

/* -------------------------------------------------------------------------- */
/* BOTTOM CONTROLS: HINT & ZOOM BUTTONS                                       */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* BOTTOM CONTROLS: HINT & ZOOM BUTTONS                                       */
/* -------------------------------------------------------------------------- */
.gameplay-bottom-controls {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: clamp(14px, 3.5vh, 28px);
    margin-bottom: 8px;
    flex-shrink: 0;
    z-index: 20;
    box-sizing: border-box;
}

.lives-counter {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2px;
    padding: 3px 6px;
    border: 1.5px solid rgba(255, 200, 140, 0.3);
    background: rgba(28, 12, 4, 0.75);
    border-radius: 14px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
    flex-shrink: 0;
    box-sizing: border-box;
}

.life-heart, .life-heart-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.45));
    transition: transform 0.25s ease, filter 0.2s ease, opacity 0.2s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.life-heart.lost, .life-heart-img.lost {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
    opacity: 0.85;
}

.life-heart.just-lost, .life-heart-img.just-lost {
    animation: heartLostPop 0.38s ease-out;
}

.lives-counter.danger .life-heart:not(.lost),
.lives-counter.danger .life-heart-img:not(.lost) {
    animation: dangerHeartPulse 0.9s infinite alternate ease-in-out;
    filter: drop-shadow(0 0 8px rgba(255, 53, 93, 0.9));
}

@keyframes dangerHeartPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

@keyframes heartLostPop {
    0% { transform: scale(1); }
    35% { transform: scale(1.45) rotate(-10deg); color: #ffffff; }
    70% { transform: scale(0.68) rotate(8deg); }
    100% { transform: scale(0.82) rotate(0); }
}

.hint-search-btn-wrapper,
.zoom-btn-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 8px; /* Prevents bottom: -8px cost badges from overflowing screen edge */
}

.hint-search-btn,
.zoom-toggle-btn {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.1s ease, filter 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

/* -------------------------------------------------------------------------- */
/* RESPONSIVE SCALING FOR TABLETS / IPADS / LARGE SCREENS & SMALL MOBILES    */
/* -------------------------------------------------------------------------- */

/* iPad & Tablet Landscape / Portrait Scaling */
@media (min-height: 800px) and (min-width: 580px) {
    .img-card-wrapper {
        max-width: min(85vw, 520px);
    }
    .question-badges-row {
        max-width: 480px;
    }
}

@media (min-height: 1000px) and (min-width: 720px) {
    .img-card-wrapper {
        max-width: min(82vw, 600px);
    }
    .question-badges-row {
        max-width: 540px;
    }
    .gameplay-bottom-controls {
        padding-bottom: 40px;
    }
}

@media (max-height: 740px) {
    .img-card-wrapper {
        width: 95%;
        max-width: 330px;
    }
    .gameplay-bottom-controls {
        gap: 16px;
        padding-bottom: 18px;
        margin-bottom: 6px;
    }
}

@media (max-height: 650px) {
    .img-card-wrapper {
        width: 92%;
        max-width: 290px;
    }
    .gameplay-header {
        padding-top: 2px;
    }
    .question-badges-row {
        max-width: 300px;
        margin-top: 1px;
    }
    .lives-counter {
        gap: 3px;
        padding: 7px;
    }
    .life-heart {
        width: 18px;
        font-size: 18px;
    }
    .gameplay-bottom-controls {
        gap: 8px;
        padding-left: 10px;
        padding-right: 10px;
        padding-bottom: 12px;
        margin-bottom: 6px;
    }
    .gameplay-action-buttons {
        gap: 10px;
    }
    .hint-search-btn,
    .zoom-toggle-btn {
        width: 50px;
        height: 50px;
    }
    .hint-search-img {
        width: 32px;
        height: 32px;
    }
    .zoom-icon {
        font-size: 22px;
    }
}
.hint-search-btn-wrapper,
.zoom-btn-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 3D Glossy Capsule Buttons matching Game UI Settings Modal & Result Buttons */
.hint-search-btn {
    position: relative;
    height: 48px;
    min-width: 145px;
    padding: 0 18px;
    border-radius: 24px;
    border: none;
    background: linear-gradient(180deg, #5ce638 0%, #2bb314 100%);
    box-shadow: 0 5px 0 #1b5e20, 0 8px 14px rgba(0, 0, 0, 0.35), inset 0 2px 2px rgba(255, 255, 255, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
}

.zoom-toggle-btn {
    position: relative;
    height: 48px;
    min-width: 145px;
    padding: 0 18px;
    border-radius: 24px;
    border: none;
    background: linear-gradient(180deg, #ffb74d 0%, #f57c00 100%);
    box-shadow: 0 5px 0 #b45300, 0 8px 14px rgba(0, 0, 0, 0.35), inset 0 2px 2px rgba(255, 255, 255, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
}

.hint-search-btn::before,
.zoom-toggle-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 55%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.08) 70%, rgba(255, 255, 255, 0) 100%);
    border-radius: 22px 22px 50% 50% / 22px 22px 12px 12px;
    pointer-events: none;
}

.action-pill-text {
    font-family: 'Fredoka One', cursive, sans-serif !important;
    font-size: 17px !important;
    font-weight: 400 !important;
    color: #ffffff !important;
    letter-spacing: 0.6px !important;
    line-height: 1 !important;
    -webkit-text-stroke: 2px #1b132b !important;
    paint-order: stroke fill !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4) !important;
    z-index: 5;
    white-space: nowrap;
}

/* Inline Side-by-Side Cost & Status Badges Inside Buttons */
.btn-cost-inline,
.btn-status-inline {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(27, 19, 43, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 14px;
    padding: 3px 8px;
    z-index: 5;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.inline-coin-icon {
    width: 17px;
    height: 17px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.inline-cost-text,
.inline-status-text {
    font-family: 'Fredoka One', cursive, sans-serif !important;
    color: #ffea4c;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    text-shadow: 0 1.5px 2px rgba(0, 0, 0, 0.6);
}

.inline-status-text {
    color: #ffffff;
}

.hint-search-btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #1b5e20, 0 3px 6px rgba(0, 0, 0, 0.25);
}

.zoom-toggle-btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #b45300, 0 3px 6px rgba(0, 0, 0, 0.25);
}

.zoom-toggle-btn.active {
    background: linear-gradient(180deg, #42a5f5 0%, #1e88e5 100%);
    box-shadow: 0 5px 0 #0d47a1, 0 8px 14px rgba(0, 0, 0, 0.35), inset 0 2px 2px rgba(255, 255, 255, 0.75);
}

.zoom-toggle-btn.active .action-pill-text {
    -webkit-text-stroke: 2px #0d47a1 !important;
}

.hint-cost-text,
.zoom-status-text {
    color: #ffea4c;
    font-size: 12px;
    font-weight: 800;
}

.zoom-status-text {
    color: #ffffff;
}

/* -------------------------------------------------------------------------- */
/* EXACT VICTORY & GAME OVER MODALS WITH ENLARGED 3D OVERLAPPING STARS         */
/* -------------------------------------------------------------------------- */
.result-card {
    position: relative;
    width: 88%;
    max-width: 325px;
    background: linear-gradient(180deg, #fffbf0 0%, #f6e6ca 100%);
    border: 5px solid #ffea4c;
    border-radius: 36px;
    padding: 36px 16px 20px 16px;
    box-shadow: 0 16px 45px rgba(0,0,0,0.7), inset 0 3px 6px rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    transform: scale(0.85);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.settings-modal-overlay.active .result-card {
    transform: scale(1);
}

.victory-green-ribbon {
    position: absolute;
    top: -26px;
    left: 50%;
    transform: translateX(-50%);
    width: 82%;
    height: 52px;
    background: linear-gradient(180deg, #7bed2f 0%, #26c014 100%);
    border: 3px solid #ffffff;
    border-radius: 26px;
    box-shadow: 0 6px 0 #1a850e, 0 10px 14px rgba(0,0,0,0.35);
    display: flex;
    justify-content: center;
    align-items: center;
}

.victory-banner-text {
    color: #ffffff;
    font-family: 'Fredoka One', cursive;
    font-size: 28px;
    letter-spacing: 1.5px;
    -webkit-text-stroke: 2.5px #155e09;
    paint-order: stroke fill;
    text-shadow: 0 3px 5px rgba(0, 0, 0, 0.4);
}

.gameover-red-ribbon {
    position: absolute;
    top: -26px;
    left: 50%;
    transform: translateX(-50%);
    width: 84%;
    height: 52px;
    background: linear-gradient(180deg, #ff5252 0%, #c62828 100%);
    border: 3px solid #ffffff;
    border-radius: 26px;
    box-shadow: 0 6px 0 #8e0000, 0 10px 14px rgba(0,0,0,0.35);
    display: flex;
    justify-content: center;
    align-items: center;
}

.gameover-banner-text {
    color: #ffffff;
    font-family: 'Fredoka One', cursive;
    font-size: 26px;
    letter-spacing: 1px;
    -webkit-text-stroke: 2.5px #6e0000;
    paint-order: stroke fill;
    text-shadow: 0 3px 5px rgba(0, 0, 0, 0.4);
}

/* Enlarged 3D Overlapping Star Arc Row */
.star-arc-row {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 14px;
    margin-bottom: 2px;
    height: 106px;
    z-index: 20;
}

/* Left & Right Stars (Big, behind center star, rotated slightly) */
.star-item {
    position: relative;
    width: 84px;
    height: 84px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    margin: 0 -12px;
}

.star-item:first-child {
    transform: rotate(-12deg) translateY(4px);
}

.star-item:last-child {
    transform: rotate(12deg) translateY(4px);
}

/* Center Star (HUGE, Elevated, Front Layer) */
.star-item.center-star {
    width: 108px;
    height: 108px;
    z-index: 5;
    transform: translateY(-10px);
    margin: 0 -10px;
}

.star-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 14px rgba(0,0,0,0.35));
    opacity: 0;
    transform: scale(0) rotate(-30deg);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.4), opacity 0.3s ease;
}

.star-img.pop-active {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    will-change: transform, opacity;
    backface-visibility: hidden;
    animation: starPopBounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.4) forwards;
}

@keyframes starPopBounce {
    0% { transform: scale(0) rotate(-45deg); opacity: 0; }
    70% { transform: scale(1.26) rotate(8deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.result-section-label {
    font-family: 'Fredoka One', cursive;
    font-size: 15px;
    color: #8d5b2c;
    letter-spacing: 1px;
    margin-top: 0px;
    margin-bottom: -6px;
    text-shadow: 0 1px 1px rgba(255,255,255,0.8);
}

.score-display-pill,
.rewards-display-pill {
    width: 88%;
    height: 42px;
    background: linear-gradient(180deg, #fff9c4 0%, #fff176 100%);
    border: 2.5px solid #ffffff;
    border-radius: 21px;
    box-shadow: 0 4px 0 #fbc02d, inset 0 2px 4px rgba(255,255,255,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: #4e2700;
    font-family: 'Fredoka One', cursive;
    font-size: 24px;
    letter-spacing: 1px;
}

.reward-coin-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.reward-amount-text {
    color: #4e2700;
    font-family: 'Fredoka One', cursive;
    font-size: 22px;
}

.result-btn-row {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 4px;
}

.result-btn-row.three-actions {
    gap: 8px;
}

.action-btn-blue-sm,
.action-btn-pink-sm,
.action-btn-orange-sm {
    position: relative;
    flex: 1;
    height: 48px;
    border-radius: 24px;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.1s ease;
}

.action-btn-blue-sm::before,
.action-btn-pink-sm::before,
.action-btn-orange-sm::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 55%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.08) 70%, rgba(255, 255, 255, 0) 100%);
    border-radius: 22px 22px 50% 50% / 22px 22px 12px 12px;
    pointer-events: none;
}

.action-btn-blue-sm {
    background: linear-gradient(180deg, #42a5f5 0%, #1e88e5 100%);
    box-shadow: 0 5px 0 #0d47a1, 0 8px 12px rgba(0,0,0,0.25), inset 0 2px 2px rgba(255,255,255,0.7);
}
.action-btn-blue-sm:active { transform: translateY(3px); box-shadow: 0 2px 0 #0d47a1; }

.action-btn-pink-sm {
    background: linear-gradient(180deg, #ff4081 0%, #c2185b 100%);
    box-shadow: 0 5px 0 #880e4f, 0 8px 12px rgba(0,0,0,0.25), inset 0 2px 2px rgba(255,255,255,0.7);
}
.action-btn-pink-sm:active { transform: translateY(3px); box-shadow: 0 2px 0 #880e4f; }

.action-btn-orange-sm {
    background: linear-gradient(180deg, #ffb74d 0%, #f57c00 100%);
    box-shadow: 0 5px 0 #b45300, 0 8px 12px rgba(0,0,0,0.25), inset 0 2px 2px rgba(255,255,255,0.7);
}
.action-btn-orange-sm:active { transform: translateY(3px); box-shadow: 0 2px 0 #b45300; }

.result-btn-text {
    color: #ffffff;
    font-family: 'Fredoka One', cursive;
    font-size: 20px;
    letter-spacing: 0.5px;
    z-index: 5;
    -webkit-text-stroke: 2.5px #1b132b;
    paint-order: stroke fill;
    text-shadow: 0 3px 5px rgba(0, 0, 0, 0.35);
}

.result-btn-row.three-actions .result-btn-text {
    font-size: 15px;
    letter-spacing: 0.2px;
    -webkit-text-stroke-width: 1.8px;
}

/* -------------------------------------------------------------------------- */
/* IPAD & TABLET OPTIMIZATIONS (Full Width & Larger Scaled UI)                */
/* -------------------------------------------------------------------------- */
@media (min-width: 550px) {
    .img-card-wrapper {
        width: 92%;
        max-width: min(540px, 36vh);
    }
    .gameplay-header {
        padding: 12px 24px 0 24px;
    }
    .gameplay-bottom-controls {
        max-width: 560px;
        gap: 24px;
        padding-left: 24px;
        padding-right: 24px;
        padding-bottom: 28px;
    }
    .gameplay-action-buttons {
        gap: 20px;
    }
    .life-heart {
        width: 27px;
        font-size: 27px;
    }
    .hint-search-btn,
    .zoom-toggle-btn {
        width: 68px;
        height: 68px;
    }
    .hint-search-img {
        width: 36px;
        height: 36px;
    }
    .zoom-icon {
        font-size: 28px;
    }
}

/* ========================================================================== */
/* REFILL YOUR HEART / OUT OF HEARTS MODAL STYLES                             */
/* ========================================================================== */
.refill-heart-card {
    position: relative;
    width: 92%;
    max-width: 330px;
    background: #fff9ed;
    border: 4px solid #f0b540;
    border-radius: 28px;
    padding: 34px 12px 14px 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45), inset 0 3px 4px #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    animation: modalPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.refill-blue-ribbon {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #42a5f5 0%, #1e88e5 100%);
    border: none;
    border-radius: 20px;
    padding: 8px 24px;
    box-shadow: 0 4px 0 #0d47a1, 0 8px 16px rgba(0, 0, 0, 0.3), inset 0 2px 2px rgba(255, 255, 255, 0.7);
    z-index: 10;
}

.refill-blue-ribbon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: 18px 18px 50% 50% / 18px 18px 10px 10px;
    pointer-events: none;
}

.refill-banner-text {
    font-size: 18px;
    color: #ffffff;
    font-weight: 900;
    text-transform: capitalize;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
}

.refill-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(180deg, #ff9f43 0%, #ee5253 100%);
    box-shadow: 0 3px 0 #b33939, 0 4px 8px rgba(0, 0, 0, 0.3), inset 0 2px 2px rgba(255, 255, 255, 0.7);
    color: #ffffff;
    font-size: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 15;
    transition: transform 0.1s ease;
}

.refill-close-btn:active {
    transform: scale(0.92);
}

/* Big Center Broken Heart Graphic */
.refill-heart-graphic-wrapper {
    position: relative;
    width: 110px;
    height: 100px;
    margin-top: 6px;
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.refill-broken-heart-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: none;
    animation: brokenHeartPulse 2.5s infinite ease-in-out;
}

@keyframes brokenHeartPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Next Heart Timer Box */
.refill-timer-box {
    width: 100%;
    background: #f7ebd4;
    border-radius: 16px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    margin-bottom: 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
}

.refill-timer-label {
    font-size: 14px;
    color: #7d4e24;
    font-weight: 800;
}

.refill-timer-countdown {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 22px;
    font-weight: 900;
    color: #9c2121;
}

.refill-clock-icon {
    font-size: 18px;
    color: #d35400;
}

/* Action Buttons Row */
.refill-action-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.refill-btn-grey, .refill-btn-green {
    position: relative;
    flex: 1;
    height: 48px;
    border-radius: 24px;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
    cursor: pointer;
    box-sizing: border-box;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    user-select: none;
    overflow: hidden;
}

.refill-btn-grey::before, .refill-btn-green::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: 22px 22px 50% 50% / 22px 22px 10px 10px;
    pointer-events: none;
}

.refill-btn-grey:active, .refill-btn-green:active {
    transform: translateY(2px);
}

.refill-btn-grey {
    background: linear-gradient(180deg, #90a4ae 0%, #607d8b 100%);
    box-shadow: 0 4px 0 #37474f, 0 6px 10px rgba(0, 0, 0, 0.2), inset 0 2px 2px rgba(255, 255, 255, 0.6);
}

.refill-btn-green {
    background: linear-gradient(180deg, #32d74b 0%, #24b33b 100%);
    box-shadow: 0 4px 0 #188027, 0 6px 10px rgba(0, 0, 0, 0.2), inset 0 2px 2px rgba(255, 255, 255, 0.6);
}

.refill-btn-title {
    font-size: 14px;
    color: #ffffff;
    font-weight: 900;
    text-shadow: 0 1.5px 3px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.refill-btn-cost {
    display: flex;
    align-items: center;
    gap: 3px;
    z-index: 2;
}

.refill-cost-coin {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.refill-cost-val {
    font-size: 14px;
    color: #ffffff;
    font-weight: 900;
    text-shadow: 0 1.5px 3px rgba(0, 0, 0, 0.4);
}

.refill-ad-badge {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    padding: 2px 5px;
    font-size: 10px;
    color: #ffffff;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 3px;
    z-index: 2;
}

.refill-free-heart-badge {
    display: flex;
    align-items: center;
    gap: 2px;
    background: #ff3b30;
    border: none;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 11px;
    color: #ffffff;
    font-weight: 900;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.6);
    z-index: 2;
}

.refill-small-heart-icon {
    width: 13px;
    height: 13px;
    object-fit: contain;
}

/* Bottom Keep Up Offer Banner */
.refill-keepup-card {
    position: relative;
    width: 100%;
    background: #eedfff;
    border: 2.5px solid #9e51ff;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.refill-sale-tag {
    position: absolute;
    top: -2px;
    left: -6px;
    background: linear-gradient(180deg, #ff4757 0%, #ff6b81 100%);
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    padding: 3px 12px;
    transform: rotate(-10deg);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 5;
}

.refill-keepup-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 8px 6px 8px;
}

.refill-coins-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.refill-coins-img {
    width: 40px;
    height: 36px;
    object-fit: contain;
}

.refill-coins-count {
    font-size: 12px;
    font-weight: 900;
    color: #6c2ebd;
}

.refill-plus-sign {
    font-size: 20px;
    font-weight: 900;
    color: #6c2ebd;
}

.refill-boosters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.booster-item {
    display: flex;
    align-items: center;
    gap: 3px;
    background: #ffffff;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 900;
    box-shadow: 0 2px 4px rgba(100, 40, 180, 0.12);
}

.booster-item.b-undo i { color: #f39c12; }
.booster-item.b-hourglass i { color: #3498db; }
.booster-item.b-swirl i { color: #9b59b6; }
.booster-item.b-wand i { color: #f1c40f; }

.booster-item span {
    color: #6c2ebd;
}

.refill-keepup-footer {
    background: #9e51ff;
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.refill-keepup-title {
    font-size: 15px;
    color: #ffffff;
    font-weight: 900;
    text-shadow: 0 1.5px 3px rgba(0, 0, 0, 0.3);
}

.refill-price-btn {
    position: relative;
    background: linear-gradient(180deg, #32d74b 0%, #24b33b 100%);
    border: none;
    border-radius: 14px;
    padding: 4px 14px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 3px 0 #188027, 0 4px 8px rgba(0, 0, 0, 0.2), inset 0 1.5px 2px rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: transform 0.1s ease;
}

.refill-price-btn:active {
    transform: translateY(2px);
}
