:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --background-color: #ecf0f1;
    --text-color: #2c3e50;
    --border-color: #bdc3c7;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    touch-action: manipulation;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px var(--shadow-color);
}

.score-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.score-box {
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px var(--shadow-color);
    min-width: 120px;
}

.score-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 5px;
}

#score, #level, #lines {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.game-area {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.game-info {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px var(--shadow-color);
    min-width: 200px;
}

.next-block {
    margin-bottom: 20px;
}

.next-block h3, .controls-info h3, .mobile-controls h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

#next-block-canvas {
    background: var(--background-color);
    border: 2px solid var(--border-color);
    border-radius: 5px;
    position: relative;
}

#next-block-canvas::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(to right, var(--border-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--border-color) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
    opacity: 0.3;
}

.controls-info ul, .mobile-controls ul {
    list-style: none;
    padding: 0;
}

.controls-info li, .mobile-controls li {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

#game-canvas {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 4px 6px var(--shadow-color);
    position: relative;
}

#game-canvas::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(to right, var(--border-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--border-color) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
    opacity: 0.3;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

.btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    transform: none;
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.modal h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.modal p {
    margin-bottom: 15px;
}

footer {
    text-align: center;
    margin-top: auto;
    padding: 20px;
    color: var(--text-color);
}

footer a {
    color: var(--secondary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 2rem;
    }

    .game-area {
        flex-direction: column;
        align-items: center;
    }

    .game-info {
        width: 100%;
        max-width: 300px;
        margin-bottom: 20px;
    }

    #game-canvas {
        width: 100%;
        max-width: 300px;
        height: auto;
    }

    .score-box {
        min-width: 100px;
        padding: 10px 15px;
    }

    .btn {
        width: 100%;
        max-width: 200px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) {
    .btn:hover {
        transform: none;
    }
}

/* Prevent text selection during gameplay */
.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
} 