:root {
    --bg-color: #0f0f1a;
    --primary-color: #ff0055;
    --secondary-color: #00e5ff;
    --grid-bg: #1a1a2e;
    --text-color: #fff;
    --font-heading: 'Press Start 2P', cursive;
    --font-body: 'Roboto', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.game-container {
    max-width: 500px;
    width: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-header {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

h1 {
    font-family: var(--font-heading);
    color: var(--secondary-color);
    font-size: 1.5rem;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
    margin-bottom: 20px;
}

.score-board {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 8px;
}

.score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.label {
    font-size: 0.7rem;
    color: #aaa;
    margin-bottom: 5px;
}

#score,
#lines,
#level {
    font-family: var(--font-heading);
    color: var(--primary-color);
    font-size: 1rem;
}

.canvas-wrapper {
    border: 4px solid var(--secondary-color);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
    background-color: var(--grid-bg);
    margin-bottom: 20px;
}

canvas {
    display: block;
    background-color: rgba(0, 0, 0, 0.8);
}

.controls-info {
    text-align: center;
}

.controls-info p {
    margin-bottom: 15px;
    color: #888;
    font-size: 0.9rem;
}

#start-btn,
#restart-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 30px;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 4px 0 #b3003b;
    transition: transform 0.1s;
    margin-bottom: 10px;
}

#start-btn:active,
#restart-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

.back-link {
    display: block;
    margin-top: 10px;
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.hidden {
    display: none;
}

.modal-content {
    background: var(--grid-bg);
    border: 2px solid var(--primary-color);
    padding: 40px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(255, 0, 85, 0.4);
}

.modal-content h2 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 20px;
}

.modal-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.btn-secondary {
    display: inline-block;
    margin-top: 15px;
    color: #aaa;
    font-size: 0.9rem;
}

/* Mobile Controls */
.mobile-controls {
    display: none;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
    justify-content: center;
}

.mobile-controls button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.5rem;
    padding: 15px;
    border-radius: 10px;
    touch-action: manipulation;
    /* Prevents double-tap zoom */
}

@media (max-width: 768px) {
    .controls-info p {
        display: none;
    }

    .mobile-controls {
        display: flex;
    }
}