/* Custom Font Declaration */
@font-face {
    font-family: 'Monstafaller Free';
    src: url('../../fonts/Monstafaller FREE.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.mmg-game {
    font-family: var(--mmg-font-family, 'Helvetica Neue', Arial, sans-serif);
    background: #f7f7fb;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(20, 34, 59, 0.12);
    max-width: 960px;
    margin: 40px auto;
    color: #2c3e50;
}

/* Play Screen Styles */
.mmg-play-screen {
    padding: 2rem 4rem 3rem 2rem;
    border-radius: 12px;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center top;
    background-image: url("data:image/svg+xml,%3Csvg width='1220' height='800' viewBox='0 0 1220 800' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_7749_5493)'%3E%3Cpath d='M0 12C0 5.37257 5.37258 0 12 0H1208C1214.63 0 1220 5.37258 1220 12V788C1220 794.627 1214.63 800 1208 800H12C5.3726 800 0 794.627 0 788V12Z' fill='%23C5DBE3'/%3E%3Cg filter='url(%23filter0_f_7749_5493)'%3E%3Cpath d='M364 910.378C364 1016.63 276.472 1102.76 168.5 1102.76C60.5283 1102.76 -27 1016.63 -27 910.378C-27 804.131 60.5283 718 168.5 718C276.472 718 364 804.131 364 910.378Z' fill='%238D0F30'/%3E%3C/g%3E%3Cg filter='url(%23filter1_f_7749_5493)'%3E%3Cellipse cx='1066.5' cy='800.378' rx='195.5' ry='192.378' fill='%23696A2E'/%3E%3C/g%3E%3Cg filter='url(%23filter2_f_7749_5493)'%3E%3Cellipse cx='107' cy='45.02' rx='124' ry='122.02' fill='%23696A2E'/%3E%3C/g%3E%3Cg filter='url(%23filter3_f_7749_5493)'%3E%3Cellipse cx='916' cy='19.02' rx='124' ry='122.02' fill='%238D0F30'/%3E%3C/g%3E%3Cg filter='url(%23filter4_f_7749_5493)'%3E%3Cpath d='M726.478 681.03C582.068 664.008 355 706.418 355 706.418C355 706.418 578.812 772.157 726.478 779.371C840.415 784.938 1018 760.987 1018 760.987C1018 760.987 843.717 694.85 726.478 681.03Z' fill='%236EA6BA'/%3E%3C/g%3E%3C/g%3E%3Cdefs%3E%3Cfilter id='filter0_f_7749_5493' x='-438.52' y='306.48' width='1214.04' height='1207.8' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'%3E%3CfeFlood flood-opacity='0' result='BackgroundImageFix'/%3E%3CfeBlend mode='normal' in='SourceGraphic' in2='BackgroundImageFix' result='shape'/%3E%3CfeGaussianBlur stdDeviation='205.76' result='effect1_foregroundBlur_7749_5493'/%3E%3C/filter%3E%3Cfilter id='filter1_f_7749_5493' x='459.48' y='196.48' width='1214.04' height='1207.8' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'%3E%3CfeFlood flood-opacity='0' result='BackgroundImageFix'/%3E%3CfeBlend mode='normal' in='SourceGraphic' in2='BackgroundImageFix' result='shape'/%3E%3CfeGaussianBlur stdDeviation='205.76' result='effect1_foregroundBlur_7749_5493'/%3E%3C/filter%3E%3Cfilter id='filter2_f_7749_5493' x='-368.3' y='-428.3' width='950.6' height='946.64' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'%3E%3CfeFlood flood-opacity='0' result='BackgroundImageFix'/%3E%3CfeBlend mode='normal' in='SourceGraphic' in2='BackgroundImageFix' result='shape'/%3E%3CfeGaussianBlur stdDeviation='175.65' result='effect1_foregroundBlur_7749_5493'/%3E%3C/filter%3E%3Cfilter id='filter3_f_7749_5493' x='380.48' y='-514.52' width='1071.04' height='1067.08' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'%3E%3CfeFlood flood-opacity='0' result='BackgroundImageFix'/%3E%3CfeBlend mode='normal' in='SourceGraphic' in2='BackgroundImageFix' result='shape'/%3E%3CfeGaussianBlur stdDeviation='205.76' result='effect1_foregroundBlur_7749_5493'/%3E%3C/filter%3E%3Cfilter id='filter4_f_7749_5493' x='234.3' y='556.3' width='904.4' height='344.61' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'%3E%3CfeFlood flood-opacity='0' result='BackgroundImageFix'/%3E%3CfeBlend mode='normal' in='SourceGraphic' in2='BackgroundImageFix' result='shape'/%3E%3CfeGaussianBlur stdDeviation='60.35' result='effect1_foregroundBlur_7749_5493'/%3E%3C/filter%3E%3CclipPath id='clip0_7749_5493'%3E%3Cpath d='M0 12C0 5.37257 5.37258 0 12 0H1208C1214.63 0 1220 5.37258 1220 12V788C1220 794.627 1214.63 800 1208 800H12C5.3726 800 0 794.627 0 788V12Z' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A");
}

.mmg-play-screen h1 {
    color: #007;
    font-size: clamp(2rem, 5vw, 6.25rem);
    margin: 0 0 1.5rem 0;
    text-transform: uppercase;
    letter-spacing: -1px;
    font-weight: bold;
    font-family: 'Monstafaller Free', Impact, 'Arial Black', sans-serif;
    font-style: normal;
    font-weight: 400;
    line-height: 125%;
}

.mmg-play-screen p {
    font-size: clamp(1rem, 2vw, 1.375rem);
    line-height: 1.8;
    margin: 0 0 2.5rem 0;
    color: #000031;
    max-width: 56.25rem;
    text-align: left;
    font-family: Arial, Helvetica, sans-serif;
    font-style: normal;
    font-weight: 400;
    line-height: 120%;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
    width: 100%;
}

.intro-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 60px;
}

.play-button {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: white;
    border: none;
    border-radius: 100px;
    padding: 10px;
    font-size: 2.5rem;
    color: #000031;
    font-family: 'Monstafaller Free', Impact, 'Arial Black', sans-serif;
    font-style: normal;
    font-weight: 400;
    line-height: 125%;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 25px rgba(0, 0, 0, 0.3);
}

.play-button:active {
    transform: translateY(0);
}

.play-icon {
    width: 60px;
    height: 60px;
    background: #8b1538;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    position: relative;
}

.play-icon:hover {
    transform: rotate(-4deg);
}

.play-icon::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 20px solid white;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    margin-left: 5px;
}

.intro-images {
    display: flex;
    gap: -10px;
    position: relative;
    margin-top: 60px;
}

.card-image {
    background: white;
    padding: 14px;
    border-radius: 8px;
    box-shadow: 4px 4px 12px 0 rgba(0, 0, 0, 0.25);
    transform: rotate(-8deg);
    height: 100%;
}

.card-image:nth-child(2) {
    transform: rotate(8deg);
    margin-top: 80px;
    margin-left: -30px;
}

.card-image img {
    display: block;
    width: 240px;
    height: 340px;
    object-fit: cover;
    border-radius: 8px;
}

/* Game Screen */
.mmg-game-screen {
    background: #f7f7fb !important;
    background-image: none !important;
    padding: 0;
}

/* Original game styles */
.mmg-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}

.mmg-title {
    font-size: 1.75rem;
    margin: 0;
}

.mmg-stats {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mmg-attempts {
    font-weight: 600;
}

.mmg-reset {
    background: linear-gradient(135deg, #4c6fff, #6a8dff);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 8px 18px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mmg-reset:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(76, 111, 255, 0.25);
}

.mmg-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
    justify-items: center;
}

.mmg-card {
    width: 100%;
    max-width: 160px;
    aspect-ratio: 7 / 10;
    perspective: 1200px;
}

.mmg-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0.2, 0.3, 1);
    cursor: pointer;
}

.mmg-card[data-open="true"] .mmg-card-inner,
.mmg-card[data-matched="true"] .mmg-card-inner {
    transform: rotateY(180deg);
}

.mmg-card-face {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    box-shadow: 0 14px 30px rgba(22, 34, 64, 0.13);
    backface-visibility: hidden;
    overflow: hidden;
    background: #1c7ed6;
    color: #fff;
    font-size: 2.25rem;
}

.mmg-card-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mmg-card-face--back {
    transform: rotateY(180deg);
    background: #12b886;
}

.mmg-card[data-matched="true"] .mmg-card-face--back {
    box-shadow: 0 0 0 2px #ffd43b inset;
}

.mmg-card[data-disabled="true"] .mmg-card-inner {
    pointer-events: none;
}

.mmg-message {
    min-height: 28px;
    margin-top: 16px;
    font-weight: 500;
    color: #4c6fff;
}

.mmg-modal::backdrop {
    background: rgba(15, 23, 42, 0.35);
}

.mmg-modal {
    border: none;
    border-radius: 16px;
    padding: 0;
    max-width: 320px;
    width: calc(100% - 32px);
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.25);
}

.mmg-modal-content {
    padding: 28px;
    display: grid;
    gap: 20px;
    text-align: center;
}

.mmg-modal-content img {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
    object-fit: cover;
    justify-self: center;
}

.mmg-modal-content p {
    margin: 0;
    font-size: 1.1rem;
}

.mmg-modal-content .button {
    justify-self: center;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .mmg-play-screen {
        padding: 2rem !important;
    }
    
    .intro-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .play-button {
        padding: 12px 35px;
        font-size: 2rem;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .play-icon {
        width: 45px;
        height: 45px;
    }
    
    .play-icon::after {
        border-left-width: 15px;
        border-top-width: 9px;
        border-bottom-width: 9px;
    }
    
    .intro-images {
        gap: 0;
        margin-top: 20px;
        align-self: center;
        justify-content: center;
        width: 100%;
    }
    
    .card-image {
        padding: 10px;
    }
    
    .card-image img {
        width: 120px !important;
        height: 180px !important;
    }
    
    .card-image:nth-child(2) {
        margin-top: 60px;
        margin-left: -20px;
    }
    
    .mmg-game {
        padding: 16px;
    }

    .mmg-board {
        gap: 12px;
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

@media (max-width: 1024px) {
    .mmg-play-screen {
        padding: 2rem !important;
    }
    
    .card-image {
        padding: 10px;
    }
    
    .card-image img {
        width: 200px !important;
        height: 300px !important;
    }
}