* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Fredoka', sans-serif;
    overflow: hidden;
    background: #111;
}

/* ===== SCREEN SYSTEM ===== */
.screen {
    display: none;
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
}
.screen.active {
    display: flex;
}

/* ===== HOME SCREEN ===== */
#home-screen {
    background: linear-gradient(180deg, #1e3a8a 0%, #3b82f6 50%, #7dd3fc 100%);
    align-items: center;
    justify-content: center;
    text-align: center;
}
.home-content {
    color: white;
    padding: 40px;
}
.game-title {
    font-family: 'Bungee', cursive;
    font-size: 96px;
    letter-spacing: 4px;
    text-shadow: 0 8px 0 #1e3a8a, 0 16px 30px rgba(0,0,0,0.5);
    margin-bottom: 20px;
    animation: bob 2s ease-in-out infinite;
}
.tagline {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 50px;
    opacity: 0.95;
}
.big-btn {
    font-family: 'Bungee', cursive;
    font-size: 64px;
    padding: 25px 90px;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    letter-spacing: 6px;
    box-shadow: 0 10px 0 #b45309, 0 15px 30px rgba(0,0,0,0.4);
    transition: all 0.1s;
    text-shadow: 0 3px 0 #b45309;
}
.big-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 0 #b45309, 0 20px 40px rgba(0,0,0,0.5);
}
.big-btn:active {
    transform: translateY(6px);
    box-shadow: 0 4px 0 #b45309, 0 6px 15px rgba(0,0,0,0.4);
}
@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}

/* ===== AIRLINE SELECT ===== */
#airline-screen {
    background: linear-gradient(180deg, #0f172a 0%, #1e3a8a 100%);
    align-items: center;
    justify-content: center;
    color: white;
}
.airline-content {
    text-align: center;
    padding: 40px;
    width: 100%;
    max-width: 1000px;
}
.select-title {
    font-family: 'Bungee', cursive;
    font-size: 48px;
    letter-spacing: 3px;
    margin-bottom: 40px;
    text-shadow: 0 5px 0 #0f172a;
}
.airline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}
.airline-card {
    font-family: 'Fredoka', sans-serif;
    background: white;
    border: none;
    border-radius: 20px;
    padding: 25px 20px;
    cursor: pointer;
    box-shadow: 0 8px 0 #cbd5e1, 0 12px 25px rgba(0,0,0,0.3);
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}
.airline-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 13px 0 #cbd5e1, 0 18px 35px rgba(0,0,0,0.4);
}
.airline-card:active {
    transform: translateY(4px);
    box-shadow: 0 4px 0 #cbd5e1, 0 6px 12px rgba(0,0,0,0.3);
}
.airline-swatch {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 4px solid #1e293b;
}
.airline-name {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 1px;
}
.small-btn {
    font-family: 'Fredoka', sans-serif;
    font-size: 18px;
    font-weight: 600;
    padding: 12px 30px;
    border: 2px solid white;
    border-radius: 12px;
    background: transparent;
    color: white;
    cursor: pointer;
    transition: all 0.15s;
}
.small-btn:hover {
    background: white;
    color: #1e3a8a;
}

/* ===== GAME SCREEN ===== */
#game-screen {
    display: none;
}
#game-screen.active {
    display: block;
}
#game-container {
    width: 100vw;
    height: 100vh;
}
#info {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px 30px;
    border-radius: 14px;
    text-align: center;
    z-index: 100;
    pointer-events: none;
    font-family: 'Fredoka', sans-serif;
}
#info h1 {
    font-family: 'Bungee', cursive;
    font-size: 22px;
    margin-bottom: 6px;
    letter-spacing: 2px;
}
#info p {
    font-size: 14px;
    color: #cbd5e1;
}
canvas {
    display: block;
}

/* ===== BANK / TURN HUD ===== */
#bank-hud {
    position: absolute;
    bottom: 30px;
    left: 30px;
    z-index: 100;
    font-family: 'Bungee', cursive;
    color: white;
    user-select: none;
    pointer-events: none;
}
#bank-dial {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 3px solid #fbbf24;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
#bank-needle {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 4px;
    height: 44px;
    background: #fbbf24;
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(0deg);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.8);
    transition: transform 0.08s linear;
}
#bank-label {
    font-size: 14px;
    letter-spacing: 2px;
    color: #fbbf24;
    margin-top: 40px;
}

/* ===== NUMERIC READOUTS ===== */
#num-hud {
    position: absolute;
    bottom: 30px;
    left: 330px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.65);
    padding: 12px 16px;
    border-radius: 12px;
    border: 2px solid #fbbf24;
    font-family: 'Bungee', cursive;
    color: white;
    user-select: none;
    pointer-events: none;
    min-width: 170px;
}
.num-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    margin-bottom: 4px;
    letter-spacing: 1px;
}
.num-label {
    color: #fbbf24;
    width: 36px;
}
.num-unit {
    color: #cbd5e1;
    font-size: 12px;
}
#spd-val, #alt-val, #thr-val {
    flex: 1;
    text-align: right;
    color: #f5f5f5;
    font-variant-numeric: tabular-nums;
}
.thr-bar {
    flex: 1;
    height: 10px;
    background: #1f2937;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #555;
}
#thr-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #10b981 0%, #fbbf24 60%, #ef4444 100%);
    transition: width 0.15s linear;
}
#stall-warn {
    margin-top: 6px;
    text-align: center;
    background: #dc2626;
    color: white;
    font-size: 18px;
    letter-spacing: 3px;
    padding: 4px 0;
    border-radius: 6px;
    box-shadow: 0 0 12px rgba(220, 38, 38, 0.8);
    animation: stallPulse 0.4s ease-in-out infinite;
}
#stall-warn.hidden { display: none; }
#ap-indicator {
    margin-top: 6px;
    text-align: center;
    background: #10b981;
    color: white;
    font-size: 14px;
    letter-spacing: 2px;
    padding: 3px 0;
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}
#ap-indicator.hidden { display: none; }
@keyframes stallPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

/* ===== COMPASS STRIP ===== */
#compass-hud {
    position: absolute;
    bottom: 180px;
    left: 170px;
    width: 140px;
    z-index: 100;
    pointer-events: none;
    user-select: none;
    font-family: 'Bungee', cursive;
}
#compass-window {
    position: relative;
    width: 100%;
    height: 30px;
    background: rgba(0,0,0,0.7);
    border: 2px solid #fbbf24;
    border-radius: 8px;
    overflow: hidden;
}
#compass-tape {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    width: 1440px;        /* 4 px per degree × 360 */
    background-image:
        linear-gradient(90deg, transparent 0, transparent calc(100% - 1px), #fbbf24 calc(100% - 1px));
    background-size: 40px 100%;     /* tick every 10° */
    color: #fff;
    font-size: 12px;
    line-height: 30px;
    white-space: nowrap;
    transform: translateX(0);
}
.compass-label {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    color: #fff;
    font-size: 12px;
    line-height: 30px;
    letter-spacing: 1px;
}
.compass-label.cardinal { color: #fbbf24; font-weight: bold; }
#compass-tick {
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 100%;
    background: #ef4444;
    transform: translateX(-50%);
    box-shadow: 0 0 4px #ef4444;
}

/* ===== ARTIFICIAL HORIZON ===== */
#ah-hud {
    position: absolute;
    bottom: 30px;
    left: 170px;
    z-index: 100;
    user-select: none;
    pointer-events: none;
    font-family: 'Bungee', cursive;
}
#ah-dial {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: #000;
    border: 3px solid #fbbf24;
    box-shadow: 0 6px 16px rgba(0,0,0,0.4), inset 0 0 0 2px #111;
    position: relative;
    overflow: hidden;
}
/* The roll layer rotates around the dial center to show bank angle */
#ah-roll {
    position: absolute;
    inset: 0;
    transform-origin: 50% 50%;
    transform: rotate(0deg);
    transition: transform 0.08s linear;
}
/* Ball: same size as the dial. Horizon = ball's vertical center (top:50%).
   Sky and ground meet there. Sky/ground extend far past the dial so they
   stay filled when the ball translates and the roll layer rotates. The
   whole ball translates Y to show pitch. */
#ah-ball {
    position: absolute;
    inset: 0;
    transform: translateY(0px);
}
#ah-sky {
    position: absolute;
    left: -100%; right: -100%;
    bottom: 50%;            /* sky's bottom edge sits at horizon = ball center */
    height: 250%;           /* extends far up so it always fills */
    background: linear-gradient(180deg, #1e6dd8 0%, #5aa9ff 100%);
}
#ah-ground {
    position: absolute;
    left: -100%; right: -100%;
    top: 50%;               /* ground's top edge sits at horizon = ball center */
    height: 250%;           /* extends far down */
    background: linear-gradient(180deg, #8a5a2a 0%, #5a3a1a 100%);
}
#ah-horizon {
    position: absolute;
    left: -50%; right: -50%;
    top: 50%;
    height: 2px;
    background: #fff;
    transform: translateY(-1px);
}
/* Pitch ladder: pivot at ball center; lines offset by --p degrees */
#ah-pitch-ladder {
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    height: 0;
}
#ah-pitch-ladder .ah-line {
    position: absolute;
    left: 50%;
    width: 60px;
    height: 2px;
    background: #fff;
    transform: translate(-50%, calc(var(--p) * -1.4px));
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#ah-pitch-ladder .ah-line span {
    color: #fff;
    font-family: 'Fredoka', sans-serif;
    font-size: 10px;
    font-weight: 600;
    transform: translateY(-1px);
    background: rgba(0,0,0,0.3);
    padding: 0 3px;
    border-radius: 2px;
}
/* Fixed aircraft symbol — does NOT rotate, sits over everything */
#ah-fixed-aircraft {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 5;
    pointer-events: none;
}
.ah-wing-l, .ah-wing-r {
    width: 22px;
    height: 4px;
    background: #fbbf24;
    box-shadow: 0 0 4px rgba(0,0,0,0.6);
}
.ah-center {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fbbf24;
    box-shadow: 0 0 4px rgba(0,0,0,0.6);
}
/* Bezel marks for bank reference (top of dial) */
#ah-bezel {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
    background:
        /* top center triangle pointer */
        linear-gradient(180deg, #fbbf24 0 8px, transparent 8px) no-repeat;
    background-position: center 4px;
    background-size: 4px 8px;
}

/* ===== SHOOT PANEL ===== */
#shoot-panel {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    font-family: 'Fredoka', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
}
#shoot-panel-row {
    /* container groups SHOOT column + info popup side-by-side */
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 14px;
}
#shoot-row {
    display: flex;
    gap: 6px;
    align-items: stretch;
}
#shoot-btn {
    font-family: 'Bungee', cursive;
    font-size: 18px;
    letter-spacing: 3px;
    padding: 12px 24px;
    background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 5px 0 #7f1d1d;
    transition: all 0.1s;
}
#shoot-btn:hover  { transform: translateY(-2px); box-shadow: 0 7px 0 #7f1d1d; }
#shoot-btn:active { transform: translateY(3px);  box-shadow: 0 2px 0 #7f1d1d; }
#shoot-info-btn {
    font-family: 'Bungee', cursive;
    font-size: 20px;
    font-weight: bold;
    padding: 0 14px;
    background: #27272a;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 5px 0 #111;
    transition: all 0.1s;
}
#shoot-info-btn:hover  { transform: translateY(-2px); box-shadow: 0 7px 0 #111; }
#shoot-info-btn:active { transform: translateY(3px);  box-shadow: 0 2px 0 #111; }

#shoot-target-list {
    list-style: none;
    margin-top: 10px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
#shoot-target-list.hidden { display: none; }
#shoot-target-list li { margin: 0; }
.shoot-target-btn {
    font-family: 'Bungee', cursive;
    font-size: 16px;
    letter-spacing: 2px;
    padding: 10px 18px;
    width: 100%;
    background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 0 #7c2d12;
    transition: all 0.1s;
    text-align: left;
}
.shoot-target-btn:hover  { transform: translateY(-2px); box-shadow: 0 6px 0 #7c2d12; }
.shoot-target-btn:active { transform: translateY(2px);  box-shadow: 0 2px 0 #7c2d12; }
.shoot-target-btn.armed {
    background: linear-gradient(180deg, #ef4444 0%, #991b1b 100%);
    box-shadow: 0 4px 0 #450a0a;
}
.shoot-target-btn.armed::after {
    content: ' — FIRE!';
    color: #fef3c7;
}

#shoot-info-popup {
    /* sits to the right of the SHOOT column */
    position: relative;
    width: 320px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    border: 2px solid #fbbf24;
    line-height: 1.45;
    align-self: flex-start;
}
#shoot-info-close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 26px;
    height: 26px;
    background: transparent;
    border: none;
    color: #fbbf24;
    font-family: 'Bungee', cursive;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    padding: 0;
    transition: background 0.1s;
}
#shoot-info-close:hover {
    background: rgba(251, 191, 36, 0.2);
}
#shoot-info-popup.hidden { display: none; }
#shoot-info-title {
    font-family: 'Bungee', cursive;
    font-size: 20px;
    letter-spacing: 2px;
    color: #fbbf24;
    margin-bottom: 8px;
}
#shoot-info-body {
    font-size: 14px;
    color: #e5e7eb;
}

/* ===== RESTART HINT ===== */
#restart-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 400;
    background: rgba(0, 0, 0, 0.8);
    color: #fbbf24;
    font-family: 'Fredoka', sans-serif;
    font-size: 22px;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: 14px;
    border: 2px solid #fbbf24;
    letter-spacing: 1px;
    animation: hintPulse 1.2s ease-in-out infinite;
}
#restart-hint.hidden { display: none; }
#restart-hint kbd {
    display: inline-block;
    background: #fbbf24;
    color: #111;
    padding: 2px 10px;
    border-radius: 6px;
    font-family: 'Bungee', cursive;
    font-size: 20px;
    margin: 0 4px;
}
@keyframes hintPulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50%      { transform: translateX(-50%) scale(1.05); }
}

/* ===== DEATH OVERLAY ===== */
#death-overlay {
    position: absolute;
    inset: 0;
    background: rgba(60, 60, 60, 0.92);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka', sans-serif;
    animation: fadeIn 0.6s ease-out;
}
#death-overlay.hidden { display: none; }
.death-content {
    text-align: center;
    color: white;
}
.death-title {
    font-family: 'Bungee', cursive;
    font-size: 120px;
    letter-spacing: 6px;
    color: #dc2626;
    text-shadow: 0 6px 0 #450a0a, 0 14px 30px rgba(0,0,0,0.6);
    margin-bottom: 50px;
    animation: shake 0.4s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes shake {
    0%   { transform: translateX(0); }
    20%  { transform: translateX(-12px); }
    40%  { transform: translateX(12px); }
    60%  { transform: translateX(-8px); }
    80%  { transform: translateX(8px); }
    100% { transform: translateX(0); }
}

