body {
    margin: 0;
    overflow: hidden;
    background-color: #000;
    font-family: 'Press Start 2P', cursive;
}

#cockpit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

#cockpit-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* mix-blend-mode: multiply makes WHITE areas transparent */
    /* and keeps dark/colored areas visible */
    mix-blend-mode: multiply;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    text-shadow: 2px 2px 0 #000;
}

#instructions {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(0, 0, 0, 0.85);
    padding: 20px 15px;
    border: 3px solid #00ff00;
    color: #00ff00;
    width: 60vw;
    max-width: 1200px;
    font-size: 18px;
    z-index: 1000;
    font-family: 'Courier New', monospace;
    cursor: pointer;
}

#game-logo {
    display: block;
    width: 80%;
    max-width: 700px;
    height: auto;
    margin: 10px auto 15px;
    border-radius: 8px;
}

#instructions h1 {
    display: none;
}

.controls-details {
    margin: 15px 0;
    text-align: center;
}

.controls-details summary {
    font-size: 1.1em;
    font-weight: bold;
    color: #ffaa00;
    cursor: pointer;
    text-transform: uppercase;
    outline: none;
    padding: 5px;
    transition: color 0.3s;
}

.controls-details summary:hover {
    color: #ffd700;
    text-shadow: 0 0 8px #ffaa00;
}

.controls-content {
    margin-top: 15px;
    background: rgba(0, 40, 0, 0.7);
    border: 1px solid #00ff00;
    padding: 15px;
    border-radius: 4px;
    font-size: 0.9em;
    text-align: left;
}

.control-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(0, 255, 0, 0.3);
}

.control-item:last-child {
    border-bottom: none;
}

.control-item span:first-child {
    color: #00ffff;
    font-weight: bold;
    padding-right: 20px;
}

#attitude-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid #444;
    background: #444;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#horizon-instrument {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Will be rotated by roll */
}

#horizon-sky {
    position: absolute;
    top: -100%;
    /* Extended for pitch movement */
    left: 0;
    width: 100%;
    height: 200%;
    background: #0088ff;
    /* Will be translated by pitch */
}

#horizon-ground {
    position: absolute;
    top: 0;
    /* Starts at middle if parent is centered, but we'll move the sky/ground container */
    left: 0;
    width: 100%;
    height: 200%;
    background: #8B4513;
    transform: translateY(50%);
    /* Start below sky */
}

/* We actually need a container for sky/ground that moves up/down */
#horizon-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    /* Wider than container to cover corners when rotated */
    height: 200px;
    transform: translate(-50%, -50%);
    /* Inner rotation and translation applied here via JS */
}

#attitude-bezel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
}

#attitude-wings {
    position: absolute;
    top: 50%;
    left: 20%;
    width: 60%;
    height: 2px;
    background: yellow;
    transform: translateY(-50%);
    z-index: 10;
    /* Fixed reference aircraft */
}

#attitude-wings::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 4px;
    background: yellow;
    transform: translate(-50%, -1px);
    border-radius: 50%;
}

canvas {
    width: 100vw !important;
    height: 100vh !important;
    display: block;
}

/* CRT Scanline Effect Overlay */
body::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    z-index: 2;
    background-size: 100% 3px, 4px 100%;
    pointer-events: none;
}