/* Sand Blast Game Page Styles */

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.game-page {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: #ffffff;
    background: linear-gradient(135deg, #0a0e1a 0%, #1a1d3a 25%, #2d1b69 50%, #1a1d3a 75%, #0a0e1a 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Language Bar */
.language-bar {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.language-selector select {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid #667eea;
    color: #ffffff;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.language-selector select:hover,
.language-selector select:focus {
    background: rgba(102, 126, 234, 0.2);
    border-color: #5a67d8;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
.game-nav {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #667eea;
    font-weight: 600;
    font-size: 1.2rem;
}

.logo-icon {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: #cbd5e0;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #667eea;
}

/* Game Main */
.game-main {
    padding: 2rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
}

.game-container {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    max-width: 800px;
    width: 100%;
    padding: 0 2rem;
}

.game-container-full {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1000px;
    width: 100%;
    padding: 0 2rem;
}

/* Game Canvas Area */
.game-canvas-area {
    position: relative;
    display: flex;
    justify-content: center;
}

.iframe-container {
    position: relative;
    display: inline-block;
}

#game-iframe {
    width: 100%;
    height: 800px;
    max-width: 1000px;
    border: 3px solid #667eea;
    border-radius: 15px;
    background: #0f1419;
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.3);
    min-width: 500px;
}

.fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid rgba(102, 126, 234, 0.6);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    z-index: 10;
}

.fullscreen-btn:hover {
    background: rgba(102, 126, 234, 0.8);
    border-color: rgba(102, 126, 234, 0.9);
    transform: translateY(-1px);
}

/* Game Overlay */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    z-index: 10;
}

.overlay-content {
    text-align: center;
    padding: 2rem;
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    max-width: 300px;
}

#overlay-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #667eea;
}

#overlay-message {
    color: #cbd5e0;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Game Info Panel */
.game-info-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 200px;
}

.score-section,
.next-pieces,
.controls-section {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 15px;
    padding: 1.5rem;
}

.score-section h3,
.next-pieces h3,
.controls-section h3 {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.stat-label {
    color: #cbd5e0;
    font-weight: 500;
}

.stat-value {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.1rem;
}

#next-canvas {
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    background: #0f1419;
    width: 100%;
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.control-key {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 50px;
    text-align: center;
}

.control-desc {
    color: #cbd5e0;
    font-size: 0.9rem;
}

/* Game Buttons */
.game-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.game-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.game-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.game-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.game-btn.secondary {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 2px solid rgba(102, 126, 234, 0.3);
}

.game-btn.secondary:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
}

/* Mobile Controls */
.mobile-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
    z-index: 1000;
}

.mobile-controls-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    max-width: 300px;
    margin: 0 auto;
}

.mobile-btn {
    background: rgba(102, 126, 234, 0.2);
    border: 2px solid rgba(102, 126, 234, 0.3);
    color: #667eea;
    padding: 1rem;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    touch-action: manipulation;
}

.mobile-btn:active {
    transform: scale(0.95);
    background: rgba(102, 126, 234, 0.4);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #1a1d3a 0%, #2d1b69 100%);
    margin: 5% auto;
    padding: 2rem;
    border: 2px solid #667eea;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: #cbd5e0;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #667eea;
}

.modal-content h2 {
    color: #667eea;
    font-family: 'Space Grotesk', sans-serif;
    margin-bottom: 1.5rem;
    padding-right: 2rem;
}

.instructions-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.instruction-section h3 {
    color: #e2e8f0;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.instruction-section p {
    color: #cbd5e0;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.instruction-section ul {
    list-style: none;
    padding-left: 0;
}

.instruction-section li {
    color: #a0aec0;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.instruction-section li::before {
    content: '→';
    color: #667eea;
    position: absolute;
    left: 0;
    font-weight: bold;
}

.instruction-section strong {
    color: #667eea;
}

/* SEO Content */
.seo-content {
    background: rgba(0, 0, 0, 0.3);
    padding: 3rem 0;
    margin-top: 2rem;
}

.seo-content h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.seo-content h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    color: #e2e8f0;
    margin: 2rem 0 1rem 0;
}

.seo-content p {
    color: #cbd5e0;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.seo-content ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1.5rem;
}

.seo-content li {
    color: #a0aec0;
    margin-bottom: 0.8rem;
    padding-left: 2rem;
    position: relative;
}

.seo-content li::before {
    content: '✓';
    color: #10b981;
    position: absolute;
    left: 0;
    font-weight: bold;
}

.seo-content strong {
    color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .game-container-full {
        padding: 0 1rem;
    }
    
    #game-iframe {
        height: 600px;
        min-width: 350px;
    }
    
    .fullscreen-btn {
        top: 5px;
        right: 5px;
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .nav-link {
        font-size: 0.9rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
        padding: 1.5rem;
    }
    
    .seo-content {
        padding: 2rem 0;
    }
    
    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .overlay-content {
        padding: 1.5rem;
        max-width: 280px;
    }
    
    #overlay-title {
        font-size: 1.3rem;
    }
    
    .game-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .mobile-controls-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    
    .mobile-btn {
        padding: 0.8rem;
        font-size: 1rem;
    }
}

/* Performance optimizations */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .game-btn, .mobile-btn {
        border-width: 3px;
    }
    
    #game-canvas {
        border-width: 4px;
    }
}

/* Print styles */
@media print {
    .mobile-controls,
    .game-nav,
    .modal {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}