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

/* BOSS WARNING */
.boss-warning {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 100%; height: 100%;
    z-index: 50;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(231, 76, 60, 0.2);
    animation: alarmPulse 0.5s infinite alternate;
    pointer-events: none;
}
.warning-stripe {
    width: 100%; height: 40px;
    background: repeating-linear-gradient(
        45deg,
        #f1c40f,
        #f1c40f 20px,
        #2c3e50 20px,
        #2c3e50 40px
    );
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    animation: stripeScroll 1s linear infinite;
}
.warning-stripe.top { margin-bottom: 20px; }
.warning-stripe.bottom { margin-top: 20px; }
.warning-text {
    font-size: 60px;
    color: #e74c3c;
    text-shadow: 0 0 15px #e74c3c, 2px 2px 0 #fff;
    font-weight: bold;
    letter-spacing: 5px;
    animation: textFlash 0.3s infinite alternate;
}
@keyframes alarmPulse {
    from { background: rgba(231, 76, 60, 0); }
    to { background: rgba(231, 76, 60, 0.4); }
}
@keyframes stripeScroll {
    from { background-position: 0 0; }
    to { background-position: 56px 0; }
}
@keyframes textFlash {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0.7; transform: scale(1.05); }
}

body {
    font-family: 'Teko', sans-serif;
    color: white;
    background-color: #74b9ff; 
    overflow: hidden; 
    user-select: none; 
}

canvas {
    display: block; width: 100vw; height: 100vh;
    z-index: 1; position: absolute; top: 0; left: 0;
}

/* In-game overlay */
#gameUI {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10; pointer-events: none; display: none; 
}
.top-bar { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px; width: 100%; }

.health-container {
    display: flex; align-items: center; background: rgba(0,0,0,0.5);
    padding: 5px 15px; border-radius: 8px; border: 2px solid #555; box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}
.health-label { font-size: 1.5rem; font-weight: bold; color: #3498db; margin-right: 15px; letter-spacing: 2px; }
.health-bar-bg { width: 150px; height: 15px; background: #333; border-radius: 4px; overflow: hidden; border: 1px inset #222; }
.health-bar-fill { width: 100%; height: 100%; background: linear-gradient(90deg, #3498db, #2980b9); transition: width 0.2s ease-out; }

.score-container {
    background: rgba(0,0,0,0.6); padding: 5px 20px; border-radius: 8px; border: 2px solid #3498db; text-align: right; box-shadow: 0 0 15px rgba(52, 152, 219, 0.4);
}
.score-label { font-size: 1rem; color: #3498db; letter-spacing: 2px; line-height: 1; }
.score-container div:last-child { font-size: 2.5rem; font-weight: 600; color: #fff; line-height: 1; text-shadow: 0 0 10px rgba(255,255,255,0.5); letter-spacing: 2px; }

/* ULTRA ABILITY KNOPPEN */
.ability-bar {
    position: absolute; bottom: 25px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 22px; pointer-events: none;
}
.ability-btn {
    pointer-events: auto;
    width: 70px; height: 70px; border-radius: 50%;
    background: rgba(0,0,0,0.55); border: 3px solid #f1c40f;
    box-shadow: 0 0 15px rgba(241,196,15,0.5); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    position: relative; transition: transform 0.1s; font-family: 'Teko', sans-serif;
    -webkit-tap-highlight-color: transparent;
}
.ability-btn .ab-icon { font-size: 2rem; line-height: 1; }
.ability-btn .ab-key {
    position: absolute; bottom: -3px; right: -3px;
    background: #f1c40f; color: #2c3e50; font-size: 1rem; font-weight: bold;
    width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; border: 2px solid #2c3e50;
}
.ability-btn:active { transform: scale(0.88); }
.ability-btn.locked { opacity: 0.35; filter: grayscale(1); border-color: #7f8c8d; box-shadow: none; cursor: not-allowed; }

/* META DASHBOARD Systeem */
.meta-overlay {
    position: absolute; top: 0; left: 0; width: 100vw; height: 100vh;
    background-image: linear-gradient(rgba(10, 15, 25, 0.5), rgba(10, 15, 25, 0.9)), 
        url('https://upload.wikimedia.org/wikipedia/commons/thumb/f/fa/F-15E_Strike_Eagle_releases_flares.jpg/1920px-F-15E_Strike_Eagle_releases_flares.jpg');
    background-size: cover; background-position: center; background-attachment: fixed;
    z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
}

.meta-header {
    display: flex; justify-content: space-between; align-items: center;
    width: 100%; max-width: 800px; padding: 30px 20px;
}
.game-logo {
    font-size: 5rem; color: #FFF; text-shadow: 0 4px 0 #34495E, 0 8px 10px rgba(0,0,0,0.8);
    letter-spacing: 4px; line-height: 1; font-weight: 700;
}
.stars-counter {
    background: rgba(0,0,0,0.6); padding: 5px 20px; border-radius: 30px; border: 2px solid #f1c40f;
    font-size: 2rem; color: #f1c40f; text-shadow: 0 0 10px rgba(241,196,15,0.5); font-weight: bold;
}

.meta-panel {
    background: rgba(20, 30, 40, 0.85); backdrop-filter: blur(8px);
    width: 100%; max-width: 800px; max-height: 85vh; border-radius: 15px; border: 2px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.9); padding: 30px; text-align: center; overflow-y: auto;
    animation: fadeIn 0.3s ease-out; display: flex; flex-direction: column; gap: 15px;
}
/* Scrollbar stylen voor de Hangar */
.meta-panel::-webkit-scrollbar { width: 10px; }
.meta-panel::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); border-radius: 5px; }
.meta-panel::-webkit-scrollbar-thumb { background: #34495e; border-radius: 5px; }
.meta-panel::-webkit-scrollbar-thumb:hover { background: #f1c40f; }
.panel-title { font-size: 3rem; color: #ecf0f1; border-bottom: 2px dashed #34495e; padding-bottom: 10px; margin-bottom: 20px; }

/* Knoppen in Main Menu */
.big-btn {
    background: #34495e; color: #ecf0f1; border: none; padding: 15px; font-size: 2rem; border-radius: 8px; cursor: pointer;
    box-shadow: 0 6px 0px #2c3e50; font-family: 'Teko', sans-serif; transition: all 0.1s; letter-spacing: 2px;
}
.big-btn:hover { background: #3e5871; transform: translateY(-2px); box-shadow: 0 8px 0px #2c3e50; }
.big-btn:active { transform: translateY(6px); box-shadow: 0 0px 0px #2c3e50; }

.play-btn { background: #e74c3c; box-shadow: 0 6px 0px #c0392b; font-size: 2.5rem; }
.play-btn:hover { background: #ee6354; box-shadow: 0 8px 0px #c0392b; }
.play-btn:active { transform: translateY(6px); box-shadow: 0 0px 0px #c0392b; }

.back-btn { background: #95a5a6; color: #2c3e50; font-size: 1.5rem; padding: 5px 20px; border-radius: 5px; border: none; cursor: pointer; margin-top: 15px; width: 120px; align-self: flex-start; }

/* Levels Grid */
.levels-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.level-btn {
    background: #27ae60; color: white; border: none; padding: 20px 0; border-radius: 10px; cursor: pointer; box-shadow: 0 6px 0px #219653; display:flex; flex-direction:column; align-items:center;
}
.level-btn:hover:not(.locked) { background: #2ecc71; transform: translateY(-2px); }
.level-btn:active:not(.locked) { transform: translateY(6px); box-shadow: 0 0px 0px #219653; }
.level-btn.locked { background: #7f8c8d; box-shadow: 0 6px 0px #34495e; cursor: not-allowed; opacity: 0.5; filter: grayscale(1); }
.lvl-num { font-size: 4rem; line-height: 1; }
.lvl-name { font-size: 1.2rem; font-family: sans-serif; letter-spacing: 1px; }

/* HANGAR UPGRADES */
.upgrades-list { display: flex; flex-direction: column; gap: 15px; }
.upgrade-item { 
    display: flex; align-items: center; background: rgba(0,0,0,0.5); padding: 10px 15px; border-radius: 8px; border: 1px solid #34495e; text-align: left;
}
.upg-icon { font-size: 2.5rem; margin-right: 20px; width: 40px; text-align: center; }
.upg-info { flex: 1; min-width: 0; display: flex; flex-direction: row; align-items: center; gap: 10px; white-space: nowrap; }
.upg-info strong { font-family: sans-serif; font-size: 1.15rem; }
.upg-bars { flex: 1; min-width: 40px; height: 12px; background: #222; border-radius: 6px; overflow: hidden; display: flex; }
.bar-fill { height: 100%; background: #f1c40f; transition: width 0.3s; }
.upg-btn { background: #f1c40f; color: #333; font-size: 1.5rem; padding: 5px 15px; border-radius: 6px; border: none; cursor: pointer; box-shadow: 0 4px 0px #d35400; font-family: 'Teko', sans-serif;}
.upg-btn:hover:not(:disabled) { background: #f39c12; }
.upg-btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0px 0px #d35400; }
.upg-btn:disabled { background: #7f8c8d; box-shadow: 0 4px 0px #34495e; color:#ccc; cursor:not-allowed; }

/* Op smalle/telefoonschermen alles compact op één rij houden */
@media (max-width: 600px) {
    .upgrade-item { padding: 8px 10px; }
    .upg-icon { font-size: 1.8rem; margin-right: 10px; width: 30px; }
    .upg-info { gap: 6px; }
    .upg-info strong { font-size: 1rem; }
    .upg-btn { font-size: 1.2rem; padding: 5px 10px; }
}

/* Trofeeën Menu styling */
.trophy-item {
    display: flex; align-items: center; background: rgba(0,0,0,0.6); padding: 15px 20px; border-radius: 10px; text-align: left; transition: all 0.3s ease; border-left: 5px solid #bdc3c7;
}
.trophy-item.unlocked { background: rgba(241, 196, 15, 0.3); border-left: 5px solid #f1c40f; }
.trophy-icon { font-size: 2.5rem; margin-right: 20px; filter: grayscale(100%); opacity: 0.5; }
.trophy-item.unlocked .trophy-icon { filter: grayscale(0%); opacity: 1; }
.trophy-text { display: flex; flex-direction: column; font-family: sans-serif; }
.trophy-text strong { color: white; font-size: 1.2rem; }
.trophy-item.unlocked .trophy-text strong { color: #f1c40f; }
.trophy-text small { color: #bdc3c7; font-size: 0.9rem; margin-top: 5px; }

/* Utils */
.hidden { display: none !important; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Death Overlay */
.death-box { background: rgba(0,0,0,0.9); padding: 40px; border-radius: 15px; border: 4px solid #c0392b; text-align: center; }
.death-box button { margin-top: 20px; background: #c0392b; color: white; border: none; padding: 10px 30px; font-size: 2rem; border-radius: 8px; cursor: pointer; font-family: 'Teko'; box-shadow: 0 6px 0px #7f8c8d; }
