* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100dvh;
    background-color: #000000;
    color: white;
    font-family: 'Orbitron', sans-serif;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

#main-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100dvh;
    z-index: 10;
    overflow-y: auto;
    padding: 20px;
}

.title-container {
    text-align: center;
    margin-bottom: 40px;
}

.main-title {
    font-size: 4rem;
    margin: 0;
    font-weight: 900;
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
    letter-spacing: 2px;
}

    .main-title span {
        color: white;
        text-shadow: none;
    }

.subtitle {
    font-size: 1.2rem;
    margin: 5px 0 0 0;
    color: #ffffff;
    letter-spacing: 4px;
    font-weight: 700;
}

.button-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

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

.btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 15px 40px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.btn-single {
    background: transparent;
    color: #ffffff;
    border: 2px solid #00ffff;
    box-shadow: inset 0 0 10px rgba(0, 255, 255, 0.2);
}

    .btn-single:hover {
        background: rgba(0, 255, 255, 0.1);
        box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    }

.btn-multi {
    background: #a855f7;
    color: #ffffff;
    border: none;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.6);
}

    .btn-multi:hover {
        background: #b975f8;
        box-shadow: 0 0 30px rgba(168, 85, 247, 0.9);
        transform: scale(1.05);
    }

.btn-small {
    background: rgba(0,0,0,0.6);
    color: #00ffff;
    border: 1px solid #00ffff;
    padding: 10px 20px;
    font-size: 1rem;
    margin: 5px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    border-radius: 4px;
    pointer-events: auto;
}

    .btn-small:hover {
        background: rgba(0, 255, 255, 0.2);
    }

.mute-btn {
    color: #ff0055 !important;
    border-color: #ff0055 !important;
}

.btn-exit {
    background: #ff0055;
    color: white;
    border-color: #ff0055;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    border-radius: 4px;
}

    .btn-exit:hover {
        background: #d40044;
        box-shadow: 0 0 15px #ff0055;
    }

.info-box {
    background: #0f0f0f;
    border: 1px solid #222;
    border-radius: 8px;
    padding: 30px;
    width: 80%;
    max-width: 800px;
    text-align: center;
    font-family: 'Arial', sans-serif;
    font-size: 0.9rem;
    color: #aaaaaa;
    line-height: 1.6;
    margin-top: 20px;
}

    .info-box strong {
        color: #dddddd;
    }

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

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: rgba(0, 0, 0, 0.75);
    border-bottom: 1px solid #00ffff;
    padding: 5px 15px;
    box-shadow: 0 2px 10px rgba(0, 255, 255, 0.1);
    pointer-events: auto;
}

#game-ui h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
    pointer-events: auto;
}

.score-box {
    font-size: 1rem;
    color: #00ffff;
    font-weight: 700;
    text-shadow: 0 0 5px #00ffff;
    margin: 0;
}

.ui-buttons {
    display: flex;
    gap: 8px;
}

#leaderboard {
    position: absolute;
    top: 60px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    text-align: left;
    color: white;
    min-width: 180px;
    box-shadow: 0 0 10px rgba(0,0,0,0.8);
    pointer-events: none;
}

#boost-btn {
    display: none;
    position: absolute;
    bottom: 40px;
    right: 40px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0, 255, 255, 0.1);
    border: 3px solid #00ffff;
    color: #00ffff;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: bold;
    pointer-events: auto;
    user-select: none;
    box-shadow: 0 0 15px rgba(0,255,255,0.4);
}

    #boost-btn:active {
        background: rgba(0, 255, 255, 0.5);
        transform: scale(0.95);
    }

@media (pointer: coarse) {
    #boost-btn {
        display: block;
    }
}

#game-over-screen {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 100;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.go-title {
    color: #ff0055;
    font-size: 4rem;
    text-shadow: 0 0 20px #ff0055;
    margin-bottom: 10px;
    text-align: center;
}

.go-score {
    color: #ffff00;
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
}

#gameCanvas {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: #000;
    cursor: crosshair;
}

#portrait-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    color: #00ffff;
    z-index: 200;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

@media screen and (orientation: portrait) and (max-width: 768px) {
    #main-menu, #game-ui, #game-over-screen, #gameCanvas {
        display: none !important;
    }

    #portrait-warning {
        display: flex;
    }
}

#info-box-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 300;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

    #info-box-modal .info-box {
        position: relative;
        display: block;
        margin: 0;
        width: 90%;
        max-width: 600px;
        text-align: left;
        box-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
    }

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ff0055;
    color: white;
    border: none;
    padding: 5px 15px;
    font-size: 1.2rem;
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
}

    .close-btn:hover {
        background: #d40044;
        box-shadow: 0 0 10px #ff0055;
    }

.action-btn {
    position: absolute;
    bottom: 40px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    font-size: 1.1rem;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    cursor: pointer;
    outline: none;
    z-index: 100;
    touch-action: none;
    user-select: none;
    transition: transform 0.1s, background-color 0.2s;
    pointer-events: auto !important;
}

    .action-btn:active {
        transform: scale(0.9);
    }

#boost-btn {
    background: rgba(0, 255, 255, 0.2);
    border: 3px solid #00ffff;
    color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

#emp-btn {
    background: rgba(153, 0, 255, 0.2);
    border: 3px solid #b700ff;
    color: #e180ff;
    box-shadow: 0 0 20px rgba(153, 0, 255, 0.5);
}

#lobby-screen {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100dvh;
    background-color: #000;
    z-index: 10;
}

.lobby-container {
    width: 95%;
    max-width: 450px;
    background: #050505;
    border: 2px solid #a855f7;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.15);
    display: flex;
    flex-direction: column;
    max-height: 95dvh;
    overflow-y: auto;
}

.lobby-panel {
    width: 100%;
    border-bottom: 1px solid #222;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

    .lobby-panel:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

.flex-row {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-bottom: 10px;
}

    .flex-row > * {
        flex: 1;
    }

.neon-select {
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    border: 1px solid #fff;
    padding: 10px;
    border-radius: 4px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    text-align: center;
    outline: none;
    cursor: pointer;
    margin-bottom: 10px;
    appearance: none;
}

    .neon-select option {
        background: #000;
        color: #fff;
    }

.lobby-container .neon-input {
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    border-radius: 4px;
    padding: 10px;
    font-size: 0.9rem;
}

.btn-logout {
    background: transparent;
    border: 1px solid #ff0055;
    color: #ff0055;
    padding: 2px 10px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: 10px;
    text-transform: uppercase;
}

    .btn-logout:hover {
        background: rgba(255, 0, 85, 0.2);
    }

.neon-input {
    background: rgba(0, 255, 255, 0.1);
    border: 2px solid #00ffff;
    color: #fff;
    padding: 10px 15px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    text-align: center;
    outline: none;
    margin-bottom: 20px;
    width: 300px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.chat-box {
    scrollbar-width: thin;
    scrollbar-color: #a855f7 #111;
}

@media (hover: hover) and (pointer: fine) {
    .joystick-btn {
        display: none !important;
    }
}

/* ==============================================================
   ULTRA-KOMPAKTNI UI ZA SVE MOBITELE U HORIZONTALNOM POLOŽAJU
   ============================================================== */
@media screen and (max-width: 950px), screen and (max-height: 500px) {
    .top-bar {
        padding: 0 5px;
        height: 26px; /* Jako smanjena visina trake */
        flex-wrap: nowrap;
        overflow: hidden;
    }

    .score-box {
        font-size: 0.55rem;
        white-space: nowrap;
        line-height: 26px;
        margin: 0;
    }

    .ui-buttons {
        display: flex;
        gap: 4px;
        align-items: center;
    }

    /* Gumbići u gornjoj traci sada su iznimno tanki i ne lome se u 2 reda */
    .top-bar .btn-small {
        padding: 0 8px !important;
        font-size: 0.5rem !important;
        white-space: nowrap !important;
        margin: 0 !important;
        height: 18px !important;
        line-height: 16px !important;
        border-width: 1px !important;
        display: inline-block;
    }

    /* Ljestvicu podižemo odmah ispod mikrotrake */
    #leaderboard {
        top: 30px;
        right: 5px;
        font-size: 0.55rem;
        min-width: 100px;
        padding: 5px;
    }

    /* Skaliranje gumbova za igru (Boost, EMP...) */
    .action-btn {
        width: 70px;
        height: 70px;
        bottom: 20px;
        font-size: 0.8rem;
    }

    /* Manji tekstovi na glavnom meniju da stanu na ekran */
    .main-title {
        font-size: 3rem;
    }

    .title-container {
        margin-bottom: 15px;
    }

    .btn {
        padding: 10px 25px;
        font-size: 1rem;
    }
}
