* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background-color: #f5f5f5;
    padding-top: 50px;
}

.container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    max-width: 1000px;
    width: 100%;
    padding: 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 220px;
    aspect-ratio: 1 / 1;
}

.left-grid {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 15px;
    border-radius: 8px;
}

.right-grid {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 15px;
    border-radius: 8px;
}

.center-grid {
    background-color: #000000;
    padding: 15px;
    border-radius: 8px;
}

.box {
    background-color: white;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    cursor: pointer;
}

.left-grid .box {
    color: #000000;
    border: 1px solid rgba(0, 0, 0, 0.3);
}

.right-grid .box {
    color: #000000;
    border: 1px solid rgba(0, 0, 0, 0.3);
}

.center-grid .box {
    color: #000000;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: white;
}

.box:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

.box.red {
    background-color: #ff3333;
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(255, 0, 0, 0.4);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.score-display {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #000;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.display-panel {
    background-color: #000;
    border: 1px solid #333;
    border-radius: 8px;
    width: 220px;
    padding: 15px;
    margin: 20px auto;
    color: white;
    font-family: 'Courier New', monospace;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    position: absolute;
    transition: background-color 0.3s ease;
}

.left-panel {
    left: 20px;
    top: calc(50% + 150px);
}

.right-panel {
    right: 20px;
    top: calc(50% + 150px);
}

.display-row {
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
}

.display-label {
    font-weight: bold;
    letter-spacing: 1px;
}

.display-value {
    color: #fff;
    letter-spacing: 2px;
}

.altitude-controls, .speed-controls, .heading-controls {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 60%;
    gap: 10px;
    align-items: center;
}

.heading-controls {
    flex-direction: column;
    right: 40%;
    transform: translate(50%, -50%);
}

.altitude-controls {
    right: 50%;
    transform: translate(50%, -50%);
}

.speed-controls {
    right: 60%;
    transform: translate(50%, -50%);
}

.alt-btn, .spd-btn, .hdg-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #333;
    color: white;
    font-size: 18px;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.alt-btn:hover, .spd-btn:hover, .hdg-btn:hover {
    background-color: #555;
    transform: scale(1.1);
}

.alt-btn:active, .spd-btn:active, .hdg-btn:active {
    background-color: #222;
    transform: scale(0.95);
}

.alt-label, .spd-label, .hdg-label {
    color: #333;
    font-weight: bold;
    margin-top: 5px;
    font-size: 14px;
    text-transform: uppercase;
}

.instructions {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    max-width: 80%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.instructions-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: none;
    font-family: 'Arial', sans-serif;
}

.instructions-panel h2 {
    text-align: center;
    margin-bottom: 15px;
    color: #fff;
}

.instructions-panel p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.instructions-panel ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.instructions-panel li {
    margin-bottom: 5px;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.play-btn {
    background-color: #006699;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.2s;
}

.play-btn:hover {
    background-color: #0088cc;
}

.instructions-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background-color: #006699;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    z-index: 50;
    transition: background-color 0.2s;
}

.instructions-btn:hover {
    background-color: #0088cc;
}

/* Media query for smaller screens */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    body {
        padding-top: 20px;
    }
    
    .grid {
        max-width: 180px;
    }
    
    .display-panel {
        position: static;
        margin-top: 20px;
        width: 180px;
    }
    
    .left-panel, .right-panel {
        position: static;
    }
}