/* Industry-Standard CSS with Security and Performance Enhancements */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Security: Prevent content injection */
.game-container *,
.overlay * {
    content: attr(data-safe-content) !important;
}

/* XSS prevention */
input, textarea {
    -webkit-user-modify: read-only;
    -moz-user-modify: read-only;
    user-modify: read-only;
}

/* Performance optimizations */
.game-container {
    will-change: transform;
    transform: translateZ(0);
}

#tetris {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

body {
    background: #000;
    color: #fff;
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

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

.game-info {
    width: 200px;
    padding: 20px;
    background: #111;
    border: 2px solid #333;
    border-radius: 10px;
}

.game-info h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #ff4444;
    font-size: 24px;
}

.stats {
    margin-bottom: 20px;
}

.stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 5px;
    background: #222;
    border-radius: 5px;
}

.performance-info {
    background: rgba(0,0,0,0.8);
    color: #0f0;
    padding: 10px;
    font-family: monospace;
    font-size: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #333;
}

.controls {
    background: #222;
    padding: 15px;
    border-radius: 5px;
}

.controls h3 {
    margin-bottom: 10px;
    color: #ff4444;
}

.controls p {
    margin-bottom: 5px;
    font-size: 14px;
}

.game-area {
    position: relative;
}

#tetris {
    background: #000;
    border: 2px solid #333;
    border-radius: 5px;
}

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

.overlay-content {
    background: #222;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #ff4444;
}

.overlay-content h2 {
    color: #ff4444;
    margin-bottom: 20px;
    font-size: 28px;
}

.overlay-content p {
    margin-bottom: 10px;
    font-size: 18px;
}

.flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    opacity: 0;
    z-index: 999;
    pointer-events: none;
    transition: opacity 0.1s;
}

.flash.active {
    opacity: 0.8;
}

.error-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff4444;
    color: white;
    padding: 15px 25px;
    border-radius: 5px;
    z-index: 9999;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
        align-items: center;
    }
    
    .game-info {
        width: 100%;
        max-width: 240px;
        order: 2;
    }
    
    .controls {
        display: none;
    }
    
    .performance-info {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .game-info {
        border: 3px solid #fff;
    }
    
    .overlay-content {
        border: 3px solid #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .flash {
        transition: none;
    }
    
    .error-message {
        animation: none;
    }
}
