/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'PressStart2P';
    src: url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
}

:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --background-color: #1a1a2e;
    --text-color: #ffffff;
    --success-color: #51cf66;
    --warning-color: #ffd93d;
    --danger-color: #ff6b6b;
    --pixel-size: 4px;
    --hud-accent: #4ecdc4;
    --hud-alert: #ff6b6b;
}

body {
    font-family: 'Press Start 2P', 'Courier New', monospace;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

/* Ad Banners */
.ad-banner {
    position: fixed;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
}

.ad-left {
    left: 0;
    top: 0;
    width: 160px;
    height: 100vh;
}

.ad-right {
    right: 0;
    top: 0;
    width: 160px;
    height: 100vh;
}

.ad-bottom {
    display: none;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 90px;
}

.ad-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 10px;
    text-align: center;
    padding: 10px;
}

/* Game Container */
.game-container {
    max-width: 900px;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    border: 4px solid var(--primary-color);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 0 50px rgba(255, 107, 107, 0.3);
    position: relative;
.brand {
    display: flex;
    align-items: center;
    gap: 15px;
}
.site-logo {
    width: 64px;
    height: 64px;
    border: 3px solid var(--secondary-color);
    border-radius: 12px;
    background: #000;
    padding: 4px;
}
}

/* Header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
.footer-link {
    color: var(--secondary-color);
    text-decoration: none;
    margin-left: 5px;
}
.footer-link:hover {
    text-decoration: underline;
}

/* Privacy Policy Page */
body.policy-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 40px 20px;
}

.policy-container {
    max-width: 900px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.7);
    border: 4px solid var(--primary-color);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.policy-header {
    text-align: center;
    margin-bottom: 30px;
}

.policy-header h1 {
    color: var(--primary-color);
    margin-top: 15px;
    font-size: 24px;
}

.policy-section {
    margin-bottom: 25px;
}

.policy-section h2 {
    color: var(--secondary-color);
    font-size: 16px;
    margin-bottom: 10px;
}

.policy-section p,
.policy-section li {
    font-size: 12px;
    line-height: 1.7;
    color: #f5f5f5;
}

.policy-section ul {
    margin-left: 20px;
    list-style: square;
}

.policy-language {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}
    border-bottom: 2px solid var(--primary-color);
    flex-wrap: wrap;
}

.game-title {
    font-size: 24px;
    color: var(--primary-color);
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
}

.header-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.language-selector {
    font-family: 'Press Start 2P', monospace;
    background: var(--secondary-color);
    color: #000;
    border: 3px solid #fff;
    padding: 8px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.language-selector:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px var(--secondary-color);
}

.btn-sound {
    background: var(--warning-color);
    border: 3px solid #fff;
    padding: 8px 12px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-sound:hover {
    transform: scale(1.1);
}

/* Screen Management */
.screen {
    display: none;
    min-height: 400px;
}

.screen.active {
    display: block;
}

.screen.overlay {
    display: none; /* Keep overlays hidden until explicitly activated */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.screen.overlay.active {
    display: flex;
}

/* Menu Screen */
.menu-content {
    text-align: center;
    padding: 40px 20px;
}

.game-logo {
    margin-bottom: 40px;
}

.pixel-text {
    font-size: 36px;
    color: var(--primary-color);
    text-shadow: 
        4px 4px 0 rgba(0, 0, 0, 0.5),
        0 0 20px var(--primary-color);
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.subtitle {
    font-size: 14px;
    color: var(--secondary-color);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}

.level-assets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.asset-chip {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.35);
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-control {
    font-family: 'Press Start 2P', monospace;
    padding: 15px 30px;
    font-size: 12px;
    border: 3px solid #fff;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background: #ff5252;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.5);
}

.btn-secondary {
    background: var(--secondary-color);
    color: #000;
}

.btn-secondary:hover {
    background: #3db8af;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.5);
}

    .level-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
    }

    .level-icon {
        font-size: 32px;
    }

    .level-name {
        font-size: 11px;
        color: var(--text-color);
        font-weight: bold;
    }

    .level-difficulty {
        font-size: 9px;
        color: var(--warning-color);
        padding: 3px 8px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 999px;
    }

    .level-snippet {
        font-size: 9px;
        color: #c7d5ff;
        line-height: 1.4;
        min-height: 38px;
        margin-bottom: 10px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        line-clamp: 3;
        overflow: hidden;
    }

    .level-selection {
        text-align: center;
        padding: 20px;
    }

.level-selection h2 {
    font-size: 24px;
    color: var(--secondary-color);
    margin-bottom: 30px;
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.level-card {
    background: linear-gradient(135deg, #2a2a3e 0%, #1a1a2e 100%);
    border: 3px solid var(--secondary-color);
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.level-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(78, 205, 196, 0.4);
    border-color: var(--primary-color);
}

.level-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.level-card.locked:hover {
    transform: none;
    box-shadow: none;
}

.level-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.level-name {
    font-size: 10px;
    margin-bottom: 5px;
    color: var(--text-color);
}

.level-difficulty {
    font-size: 8px;
    color: var(--warning-color);
}

/* Instructions */
.instructions {
    text-align: center;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.instructions h2 {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 30px;
}

.instructions-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
}

.instruction-item .key, .instruction-item .icon {
    background: var(--secondary-color);
    color: #000;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 14px;
    min-width: 60px;
    text-align: center;
}

.instruction-item p {
    font-size: 10px;
    text-align: left;
    flex: 1;
}

/* Credits */
.credits {
    text-align: center;
    padding: 40px 20px;
}

.credits h2 {
    font-size: 24px;
    color: var(--success-color);
    margin-bottom: 30px;
}

.credits p {
    font-size: 12px;
    margin: 15px 0;
}

/* Game Screen */
.game-stats {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    margin-bottom: 15px;
}

.stat {
    font-size: 10px;
    color: var(--secondary-color);
}

.stat span:last-child {
    color: var(--text-color);
    margin-left: 5px;
}

/* Gas Meter */
.gas-meter {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 10px;
}

.meter-bar {
    flex: 1;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid var(--hud-accent);
    border-radius: 10px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--hud-accent) 0%, rgba(255, 255, 255, 0.85) 100%);
    width: 0%;
    transition: width 0.3s ease;
}

#gasPercentage {
    min-width: 40px;
    text-align: right;
}

/* Detection Alert */
.detection-alert {
    display: none;
    background: var(--hud-alert);
    color: #fff;
    padding: 10px;
    text-align: center;
    font-size: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    animation: blink 0.5s infinite;
}

.detection-alert.active {
    display: block;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Canvas */
#gameCanvas {
    width: 100%;
    max-width: 800px;
    height: 500px;
    background: #2a2a3e;
    border: 3px solid var(--primary-color);
    display: block;
    margin: 0 auto 15px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Game Controls */
.game-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.hud-tip {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    margin-bottom: 10px;
    min-height: 18px;
}

/* Pause, Game Over, Level Complete Menus */
.pause-menu, .game-over-menu, .level-complete-menu {
    background: rgba(0, 0, 0, 0.95);
    border: 4px solid var(--primary-color);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
}

.pause-menu h2 {
    color: var(--warning-color);
    font-size: 28px;
    margin-bottom: 30px;
}

.game-over-menu h2 {
    color: var(--danger-color);
    font-size: 28px;
    margin-bottom: 20px;
}

.level-complete-menu h2 {
    color: var(--success-color);
    font-size: 24px;
    margin-bottom: 20px;
}

.final-score, .level-score {
    font-size: 16px;
    color: var(--secondary-color);
    margin: 20px 0;
}

.game-over-message {
    font-size: 12px;
    color: var(--text-color);
    margin: 20px 0;
}

.pause-menu button, .game-over-menu button, .level-complete-menu button {
    margin: 10px;
}

/* Footer */
.game-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid var(--primary-color);
    text-align: center;
    font-size: 8px;
    color: #999;
}

/* Social Links */
.social-links {
    margin-top: 30px;
    font-size: 10px;
    color: #999;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .ad-left, .ad-right {
        display: none;
    }
    
    .ad-bottom {
        display: block;
    }
}

@media (max-width: 768px) {
    .game-title {
        font-size: 16px;
    }
    
    .pixel-text {
        font-size: 24px;
    }
    
    .subtitle {
        font-size: 10px;
    }
    
    .btn-primary, .btn-secondary {
        padding: 12px 20px;
        font-size: 10px;
    }
    
    .levels-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    #gameCanvas {
        height: 350px;
    }
    
    .instruction-item {
        flex-direction: column;
        text-align: center;
    }
    
    .instruction-item p {
        text-align: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .game-container {
        padding: 15px;
    }
    
    .game-title {
        font-size: 14px;
    }
    
    .pixel-text {
        font-size: 20px;
    }
    
    .btn-primary, .btn-secondary {
        padding: 10px 15px;
        font-size: 9px;
    }
    
    #gameCanvas {
        height: 300px;
    }
    
    .game-stats {
        font-size: 8px;
    }
    
    .levels-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen.active {
    animation: fadeIn 0.3s ease;
}

/* Pixel Art Effects */
.pixel-border {
    border-image: repeating-linear-gradient(
        90deg,
        var(--primary-color) 0px,
        var(--primary-color) 4px,
        transparent 4px,
        transparent 8px
    ) 4;
}
