body {
    max-width: 1200px;
    min-height: 100vh;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fc1e8a;
    user-select: none;
}

.main__container{
    max-width: 1200px;
    width: 40%;
}

.container__game{
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    background: linear-gradient(325deg,
    #03001e 0%,
    #7302c0 30%,
    #ec38bc 70%,
    #fdeff9 100% );
    padding: 20px 40px;
}

h2 {
    font-size: 3em;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.reset {
    padding: 15px 20px;
    width: 100%;
    color: #000;
    background-color: #fff;
    border: none;
    font-size:1.5em ;
    letter-spacing: 0.1em;
    cursor: pointer;
    font-weight: 600;
}

.reset:focus {
    color: #ec38bc;
    background-color: #262809;
}

.game {
    width: 400px;
    height: 400px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    transform-style: preserve-3d;
    perspective: 500px;
    justify-content: center;
}

.item{
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;

    font-size: 3em;
    transform: rotateY(180deg);
    transition: 0.25s;
}

.item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #404040;
    transition: 0.25s;
    transform: rotateY(0deg);
    backface-visibility: hidden;
}

.item.boxOpen{
    transform: rotateY(0deg);
}

.boxOpen::after,
.boxMatch::after {
    transform: rotateY(180deg);
}

.toggle-switch {
    position: absolute;
    left: 5%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 30px;
    background-color: #7002bc;
    border-radius: 20px;
}

.toggle-texts {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.toggle-label {
    width: 70%;
    font-size: 1.5rem;
    color: white;
    font-weight: bold;
    text-align: center;
}

.music-name {
    font-size: 1.25rem;
    color: white;
    font-style: italic;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-switch label {
    position: relative;
    width: 50px;
    height: 26px;
    background-color: #444;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: inline-block;
}

.toggle-switch label::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-switch input[type="checkbox"]:checked + label {
    background-color: #1abc9c;
}

.toggle-switch input[type="checkbox"]:checked + label::before {
    transform: translateX(24px);
}

@media (min-width:1920px) {
    body {
        max-width: 1920px;
        flex-direction: column-reverse;
    }

    .container__game {
        padding: 40px 80px;
    }

    .game {
        width: 600px;
        height: 600px;
    }

    .item {
        width: 120px;
        height: 120px;
        font-size: 4em;
    }

    h2 {
        font-size: 4em;
    }

    .reset {
        font-size: 2em;
    }
    
    .toggle-switch {
        width: 40%;
        justify-content: space-between;
        position: relative;
        left: 0;
        padding: 10px 20px;
        margin-bottom: 30px;
    }

    .toggle-label{
        width: 70%;
    }
}

@media (min-width: 1440px) {
    body {
        max-width: 1440px;
        flex-direction: column-reverse;
    }

    .container__game {
        padding: 30px 60px;
    }

    .game {
        width: 500px;
        height: 500px;
    }

    .item {
        width: 100px;
        height: 100px;
        font-size: 3.5em;
    }

    h2 {
        font-size: 3.5em;
    }

    .reset {
        font-size: 1.8em;
    }

    .toggle-switch {
        width: 50%;
        justify-content: space-between;
        position: relative;
        left: 0;
        padding: 10px 20px;
        margin-bottom: 30px;
    }

    .toggle-label{
        width: 70%;
    }                                                       
    
}


@media (max-width: 1024px) {
    body {
        flex-direction: column;
        justify-content: center;
        gap: 20px;
    }

    .main__container{
        width: 50%;
    }

    .toggle-switch {
        width: 70%;
        justify-content: space-between;
        padding: 10px 20px;
        gap: 0;
        position: relative;
        left: 0;
        margin-bottom: 30px;
    }
}


@media (max-width: 780px) {
    body {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        padding: 5px;
    }

    .main__container {
        width: 60%;
    }

    .container__game {
        gap: 10px;
        padding: 20px;
    }

    .item {
        width: 80px;
        height: 80px;
        font-size: 2em;
    }

    h2 {
        font-size: 2em;
    }

    .reset {
        width: 85%;
        font-size: 1.2em;
    }

    .toggle-switch {
        width: 75%;
        position: relative;
        left: 0;
    }
}

@media (max-width:600px) {
    .main__container{
        width: 100%;
    }

    .item {
        width: 80px;
        height: 80px;
        font-size: 1.8em;
    }

    .reset {
        width: 90%;
        font-size: 1.5em;
    }
}

@media (max-width:320px) {

    body {
        gap: 10px;
    }

    .container__game {
        padding: 15px;
        gap: 15px;
    }

    .game {
        width: 300px;
        height: 300px;
    }

    .reset {
        width: 100%;
        padding: 10px 15px;
        font-size: 1.2em;
    }
    
    .item {
        width: 60px;
        height: 60px;
        font-size: 1.5em;
    }

    .toggle-switch {
        width: 100%;
        padding: 5px 15px;
    }
}