html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    background-color: #1D313C;
    color: #ECD6C3;
    font-family: 'Poppins', sans-serif;
}

.container {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 1rem;
}

/* HEADER STYLES */
header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    background-color: #1D313C;
    border-bottom: 3px solid #4FA3AB;
}

.logo {
    padding-left: 2rem;

    color: #ECD6C3;
    text-shadow: 0 0 5px #F6733A,
    0 0 10px #F6733A,
    0 0 20px #F6733A,
    0 0 40px #F6733A;
}


.menu {
    display: flex;
    gap: 2rem;
    padding-right: 2rem;
}

h1 {
    font-size: 2rem;
    color: #ECD6C3;
    font-family: 'Press Start 2P', cursive;
    margin: 0;
}

header a {
    text-decoration: none;
    font-size: 1rem;
    font-family: 'Press Start 2P', cursive;
    color: #ECD6C3;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px #F6733A,
    0 0 10px #F6733A,
    0 0 20px #F6733A,
    0 0 40px #F6733A;
}

header a:hover {
    color: #4FA3AB;
    text-shadow: 0 0 5px rgba(79, 163, 171, 0.7);
}

/* MAIN CONTENT STYLES */
main {
    flex: 1;
    width: 100%;
    background-color: #1D313C;
    padding: 1rem 0;
}

.games {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    padding: 30px;
    background-color: #1D313C;
}

.game-card {
    background-color: #1D313C;
    border: 4px solid #4FA3AB;
    border-radius: 8px;
    padding: 15px;
    width: 180px;
    text-align: center;
    font-family: 'Press Start 2P', cursive;
    color: #ECD6C3;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: "";
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(
            45deg,
            #F6733A,
            #4FA3AB,
            #387654,
            #F6733A
    );
    background-size: 400%;
    z-index: -1;
    opacity: 0.7;
    filter: blur(10px);
    transition: 0.5s;
}

.game-card {
    box-shadow: 4px 4px 0 #387654,
    8px 8px 0 rgba(79, 163, 171, 0.3);
}

.game-card:hover {
    box-shadow: 6px 6px 0 #F6733A,
    12px 12px 0 rgba(246, 115, 58, 0.3);
}

.game-card:hover::before {
    animation: gradientBG 3s ease infinite;
}

.game-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid #387654;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.game-card:hover .game-image {
    border-color: #F6733A;
    transform: rotate(2deg);
}

.game-card h3 {
    color: #4FA3AB;
    font-size: 14px;
    margin-bottom: 8px;
    text-shadow: 2px 2px 0 #1D313C;
}

.game-card p {
    font-size: 10px;
    color: #ECD6C3;
    margin-bottom: 12px;
    line-height: 1.4;
}

.play-button {
    background-color: #F6733A;
    color: #1D313C;
    border: none;
    padding: 10px 20px;
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    letter-spacing: 1px;

    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
}

.play-button:hover {
    background-color: #387654;
    color: #ECD6C3;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(56, 118, 84, 0.4);
}

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

.tetris-animation-container {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    pointer-events: none;
    z-index: 5;
}

.falling-block {
    width: 30px;
    height: 30px;
    position: absolute;
    bottom: 0;
    left: 0;
    fill: #F6733A;
    animation: drop-block 1.5s linear forwards;
}

@keyframes drop-block {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(180px);
        opacity: 0;
    }
}


/* FOOTER STYLES */
footer {
    background-color: #1D313C;
    color: #ECD6C3;
    padding: 1rem;
    text-align: center;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    border-top: 3px solid #4FA3AB;
}

/* SCROLLBAR STYLES */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #1D313C;
}

::-webkit-scrollbar-thumb {
    background: #4FA3AB;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #F6733A;
}


@media (max-width: 665px) {
    .menu {
        flex-direction: column;
        flex-wrap: wrap;
        gap: 1rem;
    }
}


/* GAME */

.game-instructions {
    font-family: 'Press Start 2P', cursive;
    border: 2px solid #4FA3AB;
    border-radius: 6px;
    padding: 10px;
    margin-top: 2px;
}

.game-instructions h3 {
    color: #4FA3AB;
    font-size: 12px;
    margin: 0 0 8px 0;
    text-shadow: 0 0 5px rgba(79, 163, 171, 0.7);
}

.game-instructions h6 {
    font-size: 10px;
    margin: 4px 0;
    font-weight: normal;
    letter-spacing: 0.5px;
    line-height: 1.4;
    text-align: left;
    padding-left: 0;
}

.game-instructions h6::before {
    content: "• ";
    color: #F6733A;
}

.concrete-game {
    background-color: #1D313C;
    border: 4px solid #4FA3AB;
    border-radius: 8px;
    padding: 15px;
    width: 180px;
    text-align: center;
    font-family: 'Press Start 2P', cursive;
    color: #ECD6C3;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.concrete-game {
    box-shadow: 4px 4px 0 #387654,
    8px 8px 0 rgba(79, 163, 171, 0.3);
}

.full-game {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    column-gap: 20px;
    row-gap: 30px;
}

.concrete-game {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-canvas-container {
    position: relative;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

button.muted {
    text-decoration: line-through;
    text-decoration-color: #4dbfbd;
    text-decoration-thickness: 2px;
}

#gameCanvas, #next-canvas, .stats {
    display: flex;
    border: 5px solid #F6733A;
    border-radius: 4px;
    background-color: #1D313C;
    box-shadow: 0 0 20px rgba(246, 115, 58, 0.5);
    margin: 0 auto;
}

.game-info {
    width: 100%;
    background-color: #1D313C;
    border: 4px solid #4FA3AB;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    color: #ECD6C3;
    font-family: 'Press Start 2P', cursive;
}

.game-controls {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.control-btn {
    background-color: #387654;
    color: #ECD6C3;
    border: none;
    padding: 10px 20px;
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
}

.score-display {
    font-size: 24px;
    color: #4FA3AB;
    margin: 15px 0;
    text-shadow: 0 0 5px rgba(79, 163, 171, 0.7);
}

.buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.two{
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-top: 5px;
    width: 100%;
}
.buttons button {
    background-color: #387654;
    color: #ECD6C3;
    border: none;
    border-bottom: 4px solid #2A5A40;
    border-right: 4px solid #2A5A40;
    padding: 12px 0;
    font-family: 'Press Start 2P', cursive;
    font-size: 7px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.buttons button:hover {
    background-color: #4FA3AB;
    transform: translateY(-2px);
    box-shadow: 5px 5px 0 rgba(0,0,0,0.2);
}

.buttons button:active {
    transform: translateY(1px);
    box-shadow: 1px 1px 0 rgba(0,0,0,0.2);
    border-bottom: 2px solid #2A5A40;
    border-right: 2px solid #2A5A40;
}

.buttons button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

.buttons button:hover::before {
    left: 100%;
}

#restart {
    background-color: #F6733A;
    border-bottom-color: #C45A2A;
    border-right-color: #C45A2A;
}

#pause {
    background-color: #4FA3AB;
    border-bottom-color: #3D8288;
    border-right-color: #3D8288;
}

#music {
    background-color: #9C4FAB;
    border-bottom-color: #7C3D88;
    border-right-color: #7C3D88;
}

@media (max-width: 768px) {
    .full-game {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .game-canvas-container:last-child {
        flex: 0 0 auto;
        width: 100%;
        max-width: 240px;
    }

    #gameCanvas {
        width: 100%;
        max-width: 240px;
        height: auto;
        aspect-ratio: 240/400;
    }

    #next-canvas {
        width: 80px;
        height: 96px;
    }

    .buttons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .buttons button {
        flex: 1 0 100px;
    }
}

@media (max-width: 480px) {
    .concrete-game {
        padding: 15px;
    }

    .game-info h2 {
        font-size: 18px;
    }

    .game-info p {
        font-size: 10px;
    }

    .next-block, .level, .score, .lines {
        font-size: 12px;
    }
}