body {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    margin: 0;
    padding: 20px;
    font-family: 'Arial', sans-serif;
    min-height: 100vh;
    color: #ffffff;
}

h1 {
    color: #e94560;
    margin: 0;
    text-align: center;
    font-size: 3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-right: auto;
}

.game-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 800px;
    position: relative;
}

.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 300px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 10px;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.score-info {
    display: flex;
    gap: 20px;
    font-size: 1.1em;
}

.pause-button {
    background-color: #e94560;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s ease;
}

.pause-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(233, 69, 96, 0.4);
}

#gameCanvas {
    border: 2px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.3);
    width: 300px;
    height: 600px;
    border-radius: 10px;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    margin-bottom: 20px;
    width: 300px;
}

.next-piece {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px;
    border-radius: 10px;
    color: white;
    width: 80px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#nextPieceCanvas {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.3);
    margin-top: 5px;
    width: 50px;
    height: 50px;
    border-radius: 5px;
}

.instructions-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.instructions-overlay.hidden {
    display: none;
}

.instructions-content {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 15px;
    color: white;
    max-width: 400px;
    width: 90%;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.instructions-content h2 {
    color: #e94560;
    margin-bottom: 20px;
    text-align: center;
}

.controls {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.game-rules {
    margin-top: 20px;
}

.game-rules h3 {
    color: #e94560;
    margin-bottom: 15px;
}

.game-rules ul {
    list-style-type: none;
    padding-left: 0;
}

.game-rules li {
    margin: 10px 0;
    padding-left: 20px;
    position: relative;
}

.game-rules li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #e94560;
}

.close-button {
    background-color: #e94560;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-top: 20px;
    width: 100%;
    transition: all 0.2s ease;
}

.close-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(233, 69, 96, 0.4);
}

.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 1.1em;
    padding: 8px 15px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    z-index: 100;
}

.back-button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.mobile-controls {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
    width: 100%;
    max-width: 300px;
}

.control-row {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.3rem;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.control-btn:active {
    background: rgba(233, 69, 96, 0.3);
    transform: scale(0.95);
}

#dropBtn {
    width: 120px;
    font-size: 1.2rem;
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .header-container {
        gap: 10px;
        margin-bottom: 10px;
    }

    h1 {
        font-size: 2rem;
    }

    .game-container {
        gap: 10px;
    }

    .game-header {
        width: 240px;
        padding: 8px;
    }

    #gameCanvas {
        width: 240px;
        height: 480px;
    }

    .mobile-controls {
        display: flex;
        max-width: 240px;
    }

    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        border-radius: 6px;
    }

    #dropBtn {
        width: 90px;
        font-size: 1rem;
    }

    .next-piece {
        width: 60px;
        padding: 5px;
    }

    #nextPieceCanvas {
        width: 40px;
        height: 40px;
    }

    .back-button {
        top: 5px;
        left: 5px;
        font-size: 0.9em;
        padding: 5px 10px;
    }
} 