/* NEON SWARM */
* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: #05050a;
    color: #e8ecff;
    font-family: 'Orbitron', Arial, sans-serif;
}

[hidden] { display: none !important; }

#game {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none;
    touch-action: none;
}

body.in-game { overflow: hidden; overscroll-behavior: none; }
body.in-game #game { display: block; }
body.in-game .main-nav, body.in-game .fx-canvas { display: none; }

.screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#menu {
    position: relative;
    z-index: 1;
    gap: 16px;
    padding: 48px 16px 24px;
    min-height: calc(100vh - 60px);
}

.title {
    margin: 0;
    font-size: clamp(38px, 9vw, 92px);
    font-weight: 900;
    letter-spacing: 4px;
    color: #00f3ff;
    text-shadow: 0 0 22px rgba(0, 243, 255, 0.8), 0 0 60px rgba(255, 0, 85, 0.4);
}

.tag { margin: 0 0 14px; color: #a9b0cc; font-size: clamp(12px, 2vw, 16px); letter-spacing: 1px; }

.row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.btn {
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid rgba(0, 243, 255, 0.55);
    border-radius: 10px;
    background: rgba(8, 10, 22, 0.85);
    color: #dffbff;
    font: 700 13px 'Orbitron', Arial, sans-serif;
    letter-spacing: 1px;
    cursor: pointer;
    transition: transform .12s, box-shadow .2s, background .2s;
}

.btn:hover { background: rgba(0, 243, 255, 0.14); box-shadow: 0 0 18px rgba(0, 243, 255, 0.35); transform: translateY(-1px); }
.btn:disabled { opacity: .4; cursor: default; transform: none; box-shadow: none; }
.btn.primary { padding: 16px 44px; border: 0; background: #00f3ff; color: #021014; font-size: 20px; font-weight: 900; box-shadow: 0 0 28px rgba(0, 243, 255, 0.55); }
.btn.primary:hover { background: #6ff8ff; }
.btn.danger { border-color: rgba(255, 0, 85, 0.7); color: #ff7aa5; }

.best { min-height: 18px; color: #ffd60a; font-size: 13px; letter-spacing: 1px; }

.seo {
    max-width: 720px;
    margin-top: 18px;
    padding: 16px 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(8, 10, 22, 0.75);
    font-family: Arial, sans-serif;
    color: #aab0c8;
    font-size: 14px;
    line-height: 1.6;
    text-align: left;
}

.seo h2 { margin: 0 0 8px; font: 700 15px 'Orbitron', Arial, sans-serif; color: #e8ecff; }
.seo strong { color: #00f3ff; }
.seo p { margin: 0; }

/* HUD */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    padding: env(safe-area-inset-top) 10px 0;
    pointer-events: none;
}

.xp { position: relative; height: 18px; margin: 6px 0; border: 1px solid rgba(0, 243, 255, 0.5); border-radius: 5px; background: rgba(0, 0, 0, 0.6); overflow: hidden; }
#xp-fill { height: 100%; width: 0; background: linear-gradient(90deg, #00a2ff, #00f3ff); box-shadow: 0 0 12px #00f3ff; }
#xp-level { position: absolute; inset: 0; font-size: 11px; font-weight: 900; line-height: 16px; text-shadow: 0 0 3px #000, 0 0 3px #000; }

.hud-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }

.hp { position: relative; height: 16px; max-width: 220px; border: 1px solid rgba(255, 0, 85, 0.6); border-radius: 5px; background: rgba(0, 0, 0, 0.6); overflow: hidden; }
#hp-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #ff0055, #ff5c8d); }
#hp-text { position: absolute; inset: 0; text-align: center; font-size: 10px; font-weight: 700; line-height: 14px; text-shadow: 0 0 3px #000; }

#timer { font-size: clamp(20px, 4vw, 32px); font-weight: 900; color: #fff; text-shadow: 0 0 12px #00f3ff; }

.hud-right { display: flex; justify-content: flex-end; align-items: center; gap: 8px; font-size: 11px; color: #c9cfe6; }
.hud-right span { color: #fff; font-weight: 900; font-size: 14px; }

#btn-pause, #btn-fs {
    pointer-events: auto;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

#boss-bar { position: relative; width: min(560px, 90%); height: 16px; margin: 6px auto 0; border: 1px solid #ff0055; border-radius: 5px; background: rgba(0, 0, 0, 0.7); overflow: hidden; }
#boss-fill { height: 100%; background: linear-gradient(90deg, #ff0055, #ffae00); box-shadow: 0 0 14px #ff0055; }
#boss-name { position: absolute; inset: 0; font-size: 10px; font-weight: 900; line-height: 14px; letter-spacing: 2px; text-shadow: 0 0 3px #000, 0 0 3px #000; }

#loadout { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 6px; max-width: 240px; }

.slot {
    position: relative;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 1px solid var(--c);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.55);
    color: var(--c);
    font-size: 13px;
    line-height: 1;
}

.slot.passive { border-radius: 50%; }
.slot.evolved { background: var(--c); color: #020208; box-shadow: 0 0 10px var(--c); }
.slot i { position: absolute; right: -2px; bottom: -3px; font: 900 8px 'Orbitron', Arial, sans-serif; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }

/* Prozori preko igre */
.modal {
    position: fixed;
    inset: 0;
    z-index: 10;
    justify-content: center;
    gap: 16px;
    padding: 16px;
    overflow-y: auto;
    background: rgba(2, 3, 12, 0.78);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal h2 { margin: 0; font-size: clamp(24px, 5vw, 42px); font-weight: 900; letter-spacing: 3px; color: #00f3ff; text-shadow: 0 0 20px rgba(0, 243, 255, 0.7); }

#cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; width: 100%; max-width: 900px; }

.card {
    position: relative;
    flex: 1 1 220px;
    max-width: 280px;
    min-height: 200px;
    padding: 18px 14px;
    border: 2px solid var(--c);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(20, 24, 50, 0.96), rgba(6, 7, 18, 0.98));
    box-shadow: 0 0 22px color-mix(in srgb, var(--c) 40%, transparent);
    color: #e8ecff;
    font-family: 'Orbitron', Arial, sans-serif;
    cursor: pointer;
    transition: transform .12s, box-shadow .15s;
    animation: card-in .22s cubic-bezier(.2, 1.4, .4, 1) backwards;
}

.card:hover, .card:focus-visible { transform: translateY(-5px) scale(1.02); box-shadow: 0 0 36px var(--c); outline: 0; }
.card .ico { font-size: 38px; color: var(--c); text-shadow: 0 0 16px var(--c); line-height: 1.2; }
.card h3 { margin: 8px 0 4px; font-size: 15px; color: var(--c); letter-spacing: 1px; }
.card .kind { font-size: 10px; letter-spacing: 2px; color: #9aa2c2; }
.card p { margin: 10px 0 0; font: 13px/1.45 Arial, sans-serif; color: #c9cfe6; }
.card .key { position: absolute; top: 8px; left: 10px; font-size: 11px; color: #6d7596; }
.card.evolve { background: linear-gradient(160deg, #3a2500, #1a0a30); animation: card-in .22s backwards, evolve-glow 1s infinite alternate; }

@keyframes card-in { from { opacity: 0; transform: translateY(24px) scale(.9); } }
@keyframes evolve-glow { to { box-shadow: 0 0 44px var(--c); } }

@media (max-height: 560px), (max-width: 720px) {
    #cards { flex-direction: column; align-items: center; flex-wrap: nowrap; gap: 8px; }
    .card { flex: none; width: 100%; max-width: 460px; min-height: 0; padding: 10px 12px 10px 66px; text-align: left; }
    .card .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 30px; }
    .card h3 { margin: 2px 0; }
    .card p { margin: 4px 0 0; font-size: 12px; }
    .card .key { display: none; }
}

#pause-stats, #over-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; width: min(560px, 100%); }
.stat { padding: 10px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 10px; background: rgba(0, 0, 0, 0.4); }
.stat b { display: block; font-size: 20px; color: #fff; }
.stat span { font-size: 10px; letter-spacing: 1px; color: #9aa2c2; }
.stat.hl b { color: #ffd60a; text-shadow: 0 0 10px rgba(255, 214, 10, 0.6); }

#panel-body { display: flex; flex-direction: column; gap: 8px; width: min(560px, 100%); text-align: left; }
#panel-body .help { font: 14px/1.6 Arial, sans-serif; color: #c9cfe6; }
#panel-body .help b { color: #00f3ff; }

.shop-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 10px; background: rgba(0, 0, 0, 0.4); }
.shop-row h3 { margin: 0; font-size: 13px; color: #00f3ff; }
.shop-row p { margin: 3px 0 0; font: 12px Arial, sans-serif; color: #aab0c8; }
.shop-row.on { border-color: #00f3ff; box-shadow: 0 0 12px rgba(0, 243, 255, 0.35); }
.credits { color: #ffd60a; font-size: 15px; font-weight: 900; text-align: center; }
