* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    user-select: none;
}

.game-container {
    width: 160px;
    height: 900px;
    display: flex;
    flex-direction: column;
    background: #2a2a2a;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

/* Top Info Bar */
.top-bar {
    display: flex;
    justify-content: space-around;
    background: #1a1a1a;
    padding: 8px 5px;
    border-bottom: 2px solid #00d4ff;
}

.info-item {
    text-align: center;
    flex: 1;
}

.info-label {
    color: #888;
    font-size: 8px;
    font-weight: bold;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.info-value {
    color: #00d4ff;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.5);
}

/* Game Board */
.game-board {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #0a0a0a;
    padding: 5px;
}

#gameCanvas {
    display: block;
    background: #000;
    border: 1px solid #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

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

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

.overlay-title {
    color: #ff4444;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 
        0 0 10px rgba(255, 68, 68, 0.8),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 2px;
}

.overlay-button {
    background: linear-gradient(180deg, #00d4ff 0%, #0088cc 100%);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    padding: 10px 25px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid #00ffff;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.6),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    transition: all 0.2s;
    letter-spacing: 2px;
}

.overlay-button:hover {
    background: linear-gradient(180deg, #00ffff 0%, #00aaee 100%);
    transform: translateY(-2px);
}

.overlay-button:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.6),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Next Piece Display */
.next-display {
    background: #1a1a1a;
    padding: 8px;
    text-align: center;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
}

.next-label {
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

#nextCanvas {
    display: block;
    margin: 0 auto;
    background: #0a0a0a;
    border: 1px solid #2a2a2a;
    border-radius: 3px;
}

/* Touch Controls */
.touch-controls {
    background: #1a1a1a;
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

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

.control-btn {
    background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 100%);
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 6px;
    border: 1px solid #5a5a5a;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.6),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
    transition: all 0.1s;
    user-select: none;
    flex: 1;
    max-width: 35px;
    min-height: 28px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.control-btn:active {
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    transform: translateY(1px);
    box-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.8),
        inset 0 1px 2px rgba(0, 0, 0, 0.6);
}

.rotate-btn {
    max-width: 70px;
    font-size: 14px;
}

.drop-btn {
    background: linear-gradient(180deg, #ff6644 0%, #cc3322 100%);
    border-color: #ff8866;
    font-size: 10px;
    letter-spacing: 0.5px;
    max-width: 70px;
}

.drop-btn:active {
    background: linear-gradient(180deg, #cc3322 0%, #991100 100%);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .game-container {
        width: 100vw;
        height: 100vh;
        max-width: 100%;
        max-height: 100%;
    }

    .info-label {
        font-size: 7px;
    }

    .info-value {
        font-size: 11px;
    }

    .overlay-title {
        font-size: 18px;
    }

    .overlay-button {
        font-size: 14px;
        padding: 8px 20px;
    }

    .control-btn {
        font-size: 10px;
        padding: 5px;
        min-height: 26px;
        max-width: 32px;
    }

    .rotate-btn {
        font-size: 13px;
        max-width: 65px;
    }

    .drop-btn {
        font-size: 9px;
        max-width: 65px;
    }
}
