* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: white;
}

.back-home {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.back-home a {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.back-home a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-5px);
}

.game-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.main-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-header h1 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #00f0f0, #f0a000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.game-board {
    position: relative;
    margin: 20px 0;
}

#tetrisCanvas {
    display: block;
    background: #000;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    z-index: 10;
}

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

.overlay-content {
    text-align: center;
}

.overlay-content h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #00f0f0;
}

.overlay-content p {
    color: #ccc;
}

.game-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #00f0f0, #0080ff);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 240, 240, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(240, 147, 251, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #feca57, #ff9ff3);
    color: #333;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(254, 202, 87, 0.4);
}

.side-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 250px;
}

.stats {
    margin-bottom: 30px;
}

.stats h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #00f0f0;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 10px;
}

.stat-label {
    color: #ccc;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #00f0f0;
}

.next-piece {
    margin-bottom: 30px;
}

.next-piece h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #00f0f0;
}

.next-preview {
    background: #1a1a2e;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#nextCanvas {
    display: block;
}

.instructions {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
}

.instructions h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #00f0f0;
}

.key-hints {
    display: grid;
    gap: 8px;
}

.key-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ccc;
}

kbd {
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    font-family: monospace;
    font-size: 0.9rem;
    min-width: 40px;
    text-align: center;
}

@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
    }

    .side-panel {
        width: 100%;
    }

    .game-controls {
        grid-template-columns: 1fr;
    }
}
