body {
    min-height: 100vh;
    min-width: 100vw;
    background-color: #12181f;
    color: white;
}

p {
    text-align: center;
    font-size: 100%;
    font-weight: bold;
    padding-top: 15%;
}

h2 {
    color: #000000;
}

.logo {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 70%;
}

.mini-logo {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 30%;
}

.header {
    text-align: center;
    font-weight: 700;
    font-size: 35px;
}

.sec-header {
    color: #ffffff;
    margin: auto auto;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: solid 1px #e1e1e1;
    width: 90%;
    text-align: center;
}

.column {
    padding-top: 10px;
    float: left;
}

.column.side {
    width: 25%;
}

.column.middle {
    width: 50%;
    height: 75%;
}

.column.equal {
    width: 33%;
}

.topnav {
    overflow: hidden;
    background-color: #333;
    display: flex;
    justify-content: center;
}

.topnav a {
    float: left;
    display: block;
    color: #f2f2f2;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
}

.topnav a:hover {
    background-color: #ddd;
    color: black;
}

.actions {
    display: flex;
    justify-content: space-evenly;
    gap: 5px;
}

.actions button {
    padding: 8px 16px;
    font-size: 80%;
    font-weight: bold;
    border-radius: 10px;
    background-color: #6600cc;
    color: white;
    margin: 5px 5px;
    margin-left: auto;
    margin-right: auto;
    width: 70%;
}

.square-button {
    width: 50px;
    height: 50px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 15px;
    border-radius: 10px;
    margin: auto auto;
}


.grid-container {
    padding: 20px;
    display: grid;
    justify-content: center;
    grid-gap: 2%;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    transform-origin: top;
    transform: scale(0.9);
}


.card {
    height: 95%;
    width: 95%;
    border-radius: 10px;
    background-color: white;
    position: relative;
    transform-style: preserve-3d;
    transition: all 0.5s ease-in-out;
}

.front-image {
    width: 60px;
    height: 60px;
}

.card.flipped {
    transform: rotateY(180deg);
}

.front,
.back {
    backface-visibility: hidden;
    position: absolute;
    border-radius: 10px;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
}

.card .front {
    display: flex;
    justify-content: center;
    align-items: center;
    transform: rotateY(180deg);
}

.card .back {
    background-image: url("data:image/svg+xml,<svg id='patternId' width='100%' height='100%' xmlns='http://www.w3.org/2000/svg'><defs><pattern id='a' patternUnits='userSpaceOnUse' width='69.282' height='40' patternTransform='scale(2) rotate(0)'><rect x='0' y='0' width='100%' height='100%' fill='%23161414ff'/><path d='M34.641-20v80m34.64-40L0-20m69.282 80L0 20m69.282 0L0 60m69.282-80L0 20m69.282-40v80M0-20v80M34.64 40l11.547-20m11.547 20l11.547 20M34.641 40h23.094m11.547-20L57.735 40M46.188 20L34.641 40l11.547 20h23.094L80.83 40 69.282 20H46.188zM34.641 40l11.547-20m11.547 20l11.547 20M34.641 40h23.094m11.547-20L57.735 40M46.188 20L34.641 40l11.547 20h23.094L80.83 40 69.282 20H46.188zM34.641 0l11.547-20M57.735 0l11.547 20M34.642 0h23.093m11.547-20L57.735 0M46.188-20L34.641 0l11.547 20h23.094L80.83 0 69.282-20H46.188zM34.641 40L23.094 20M11.547 40L0 60m34.64-20H11.548M0 20l11.547 20m11.547-20l11.547 20-11.547 20H0l-11.547-20L0 20h23.094zM34.641 0L23.094-20M11.547 0L0 20M34.64 0H11.548M0-20L11.547 0m11.547-20L34.641 0 23.094 20H0L-11.547 0 0-20h23.094z'  stroke-width='1' stroke='%23805ad5ff' fill='none'/></pattern></defs><rect width='800%' height='800%' transform='translate(0,0)' fill='url(%23a)'/></svg>");
    background-position: center center;
    background-size: cover;
    backface-visibility: hidden;
}

.actions button:hover {
    background-color: #a06fd1;
    color: white;
}

#nameModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    width: 250px;
}

.modal-input {
    display: flex;
    align-items: center;
    justify-content: left;
}

.leaderboard {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid #000;
    padding: 10px;
    width: 60%;
    background-color: #a06fd1;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    text-align: left;
}

.player span {
    font-weight: bold;
}

.menu-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 90vh;
}

#menuContent.hidden {
    display: none;
}

#gameOverModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* Yarı saydam arka plan */
    color: white;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10;
    /* Diğer içeriklerin üstünde göster */
    backdrop-filter: blur(2px);
}

#gameOverModalLose {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* Yarı saydam arka plan */
    color: white;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10;
    /* Diğer içeriklerin üstünde göster */
    backdrop-filter: blur(2px);
}

.game-modal-content {
    padding: 35px;
    border-radius: 20px;
    text-align: center;
    width: 40%;
    height: auto;
    background-color: #b699d3;
    transform: scale(0.85);
}

.game-modal-content .actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 25px;
}

.game-modal-content h2 {
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    -webkit-text-stroke: #6600cc 2px;
    text-shadow: #000000 5px 5px 5px;
    font-size: 45px;
}

.game-modal-content p {
    color: #ffffff;
    -webkit-text-stroke: 1px black;
    font-size: 27px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    padding-top: 0;
    margin-top: 0;
    margin-bottom: 0;
}

.game-modal-content #finalScore {
    font-size: 50px;
    -webkit-text-stroke: 5px black;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    margin-bottom: 30;
}

.side p {
    font-size: 20px;
    font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
    padding-top: 0;
}

.error-message {
    color: red;
    display: none;
    margin-top: 10px;
}

.time {
    font-family: 'monospace';
    font-size: 1em;
    width: 4rem;
    text-align: center;
    padding: 0.5rem 0;
    margin: 0;
}

@media (max-width: 900px) and (orientation: portrait) {
    .game-modal-content {
        transform: scale(0.90);
        width: 70%;
    }
}

@media (max-width: 768px) and (orientation: portrait) {

    .column.side,
    .column.middle {
        width: 100%;
        float: none;
        clear: both;
    }

    .column.middle {
        height: 70%;
    }

    .column.equal {
        width: 100%;
        margin-bottom: 15%;
    }

    .actions {
        font-size: 70%;
    }

    .grid-container {
        grid-template-columns: repeat(2, 1fr);
        transform: scale(0.8);
    }

    .card {
        width: 90%;
        height: 90%;
    }

    .header {
        font-size: 25px;
    }

    .game-modal-content {
        transform: scale(0.75);
    }
}

@media (max-width: 550px) and (orientation: portrait) {
    .column.middle {
        height: 60%;
    }

    .grid-container {
        grid-template-columns: 1fr;
        transform: scale(0.7);
    }

    .card {
        width: 85%;
        height: 85%;
    }

    .header {
        font-size: 20px;
    }

    .game-modal-content {
        transform: scale(0.75);
    }

    .game-modal-content h2 {
        font-size: 26px;
        text-shadow: #000000 2px 2px 2px;
        -webkit-text-stroke: #6600cc 1px;
    }
}

@media (max-width: 375px) and (orientation: portrait) {
    .grid-container {
        grid-template-columns: 1fr;
        transform: scale(0.65);
    }

    .card {
        width: 80%;
        height: 80%;
    }

    .header {
        font-size: 15px;
    }

    .game-modal-content h2 {
        font-size: 24px;
    }

    .game-modal-content {
        transform: scale(0.65);
        width: 85%;
    }
}

@media (max-width: 900px) and (orientation: landscape) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
        transform: scale(0.5);
    }

    .card {
        width: 90%;
        height: 90%;
    }

    .header {
        font-size: 25px;
    }

    .leaderboard {
        transform: scale(0.7);
        transform-origin: top;
    }

    .game-modal-content {
        transform: scale(0.75);
        width: 70%;
    }

    .column.equal {
        width: 100%;
        margin-bottom: 30%;
    }
}