* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Press Start 2P', cursive;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 1200px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    margin-bottom: 30px;
    text-align: center;
    width: 100%;
}

h1 {
    font-size: 2.5em;
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    margin-bottom: 10px;
}

.subtitle {
    color: #4a90e2;
    font-size: 0.8em;
    margin-bottom: 20px;
}

.game-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    margin-bottom: 20px;
    width: 100%;
    position: relative;
}

.controls-sidebar {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 180px;
}

.controls-box {
    background: rgba(26, 26, 46, 0.9);
    padding: 20px;
    border-radius: 15px;
    border: 3px solid #4a90e2;
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.5);
    position: relative;
    overflow: hidden;
}

.controls-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #00ff88, #4a90e2);
}

.controls-box h3 {
    color: #00ff88;
    font-size: 0.8em;
    margin-bottom: 20px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.5);
    white-space: nowrap;
}

.arrow-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.arrow-row {
    display: flex;
    gap: 8px;
}

.arrow {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(74, 144, 226, 0.2);
    border: 2px solid #4a90e2;
    border-radius: 8px;
    font-size: 1.3em;
    color: #4a90e2;
    text-shadow: 0 0 5px rgba(74, 144, 226, 0.5);
    transition: all 0.2s ease;
}

.arrow:hover {
    background: rgba(74, 144, 226, 0.4);
    transform: scale(1.05);
}

#game-container {
    width: 500px;
    height: 300px;
    border: 3px solid #00ff88;
    position: relative;
    background-color: rgba(26, 26, 46, 0.8);
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
    margin: 0 auto;
}

#player {
    width: 20px;
    height: 20px;
    background-color: #4a90e2;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(74, 144, 226, 0.8);
    transition: all 0.1s ease;
}

#flag {
    width: 20px;
    height: 20px;
    background-color: #ff4757;
    position: absolute;
    bottom: 0;
    right: 0;
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(255, 71, 87, 0.8);
    transition: all 0.3s ease;
}

.obstacle {
    width: 30px;
    height: 30px;
    background-color: #2ed573;
    position: absolute;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(46, 213, 115, 0.8);
}

.game-controls {
    margin-top: 20px;
    width: 100%;
    text-align: center;
}

#message {
    color: #4a90e2;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
    font-size: 0.9em;
    text-shadow: 0 0 5px rgba(74, 144, 226, 0.5);
}

#hidden-flag {
    width: 20px;
    height: 20px;
    background-color: #ffd700;
    position: absolute;
    top: 350px;
    left: 250px;
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    z-index: 10;
}

#hidden-area {
    position: absolute;
    top: 300px;
    left: 0;
    width: 500px;
    height: 100px;
    background-color: rgba(26, 26, 46, 0.8);
    z-index: 5;
}

.instructions {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.instructions h3 {
    color: #00ff88;
    font-size: 0.8em;
    margin-bottom: 10px;
}

.instructions p {
    color: #fff;
    font-size: 0.7em;
}

@media (max-width: 800px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .game-wrapper {
        flex-direction: column;
        gap: 20px;
    }
    
    .controls-sidebar {
        position: static;
        transform: none;
        width: 100%;
        margin-bottom: 20px;
    }
    
    .controls-box {
        max-width: 300px;
        margin: 0 auto;
    }
    
    #game-container {
        width: 100%;
        max-width: 500px;
        height: 250px;
    }
}
