/* =========================================================
   BASE
========================================================= */

* {
    box-sizing: border-box;
}

html,
body {

    margin: 0;

    width: 100%;
    height: 100%;

    overflow: hidden;

    background: #0b0d12;

    font-family: Arial, sans-serif;

    color: white;
}


#game-container {

    position: relative;

    width: 100vw;
    height: 100vh;
}


canvas {

    display: block;

    width: 100%;
    height: 100%;
}


/* =========================================================
   INTERFACE
========================================================= */

#ui {

    position: absolute;

    top: 20px;
    left: 20px;

    z-index: 10;

    pointer-events: none;
}


.panel {

    width: 250px;

    background:
        rgba(10, 12, 18, .85);

    border:
        1px solid rgba(255,255,255,.12);

    border-radius: 12px;

    padding: 14px 16px;

    backdrop-filter: blur(8px);
}


.stat-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    font-size: 14px;

    font-weight: bold;
}


.stat {

    margin-bottom: 12px;
}


.bar {

    width: 100%;

    height: 16px;

    margin-top: 7px;

    background: #2b2f39;

    border-radius: 999px;

    overflow: hidden;
}


.bar-fill {

    height: 100%;

    width: 100%;

    transition:
        width .15s linear;
}


#health {

    background: #4ade80;
}


#xp {

    background: #a855f7;
}


#score {

    margin-top: 10px;

    font-size: 14px;

    color: #d1d5db;
}


/* =========================================================
   BOUTON PAUSE
========================================================= */

#pause-button {
    position: fixed;
    top: 20px;
    right: 20px;
    left: auto;

    z-index: 100;

    padding: 10px 18px;

    border: 1px solid rgba(255,255,255,.15);
    border-radius: 10px;

    background: rgba(10, 12, 18, .9);

    color: white;

    font-size: 14px;
    font-weight: bold;

    cursor: pointer;

    backdrop-filter: blur(8px);

    transition:
        background .15s,
        transform .15s;
}

#pause-button:hover {
    background: rgba(40, 45, 55, .95);
    transform: scale(1.03);
}


/* =========================================================
   OVERLAY PAUSE
========================================================= */

#pause-overlay {

    position: absolute;

    inset: 0;

    z-index: 25;

    display: none;

    align-items: center;

    justify-content: center;

    background:
        rgba(0, 0, 0, .55);

    backdrop-filter:
        blur(3px);

    pointer-events: none;
}


#pause-overlay.active {

    display: flex;

    pointer-events: auto;
}

#pause-stats {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: white;
    background: rgba(0, 0, 0, 0.85);
    font-family: sans-serif;
}

#pause-stats h2 {
    margin-bottom: 10px;
    font-size: 32px;
}

#player-stats {
    min-width: 260px;
    padding: 18px 28px;
    border: 1px solid #666;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
}

#player-stats p {
    margin: 10px 0;
}

#resume-button {
    padding: 12px 26px;
    border: none;
    border-radius: 8px;
    background: #36a852;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

#resume-button:hover {
    background: #27833e;
}

.pause-box {

    min-width: 300px;

    padding: 30px;

    text-align: center;

    background:
        rgba(15, 18, 25, .95);

    border:
        1px solid rgba(255,255,255,.12);

    border-radius: 18px;

    box-shadow:
        0 20px 60px rgba(0,0,0,.4);
}


.pause-box h1 {

    margin-top: 0;

    margin-bottom: 8px;
}


.pause-box p {

    color: #9ca3af;

    margin-bottom: 24px;
}


.pause-box button {

    border: 0;

    border-radius: 10px;

    padding: 12px 24px;

    background: #4ade80;

    color: #07130b;

    font-weight: bold;

    cursor: pointer;
}


/* =========================================================
   GAME OVER
========================================================= */

#game-over {

    position: absolute;

    inset: 0;

    display: none;

    align-items: center;

    justify-content: center;

    background:
        rgba(0,0,0,.72);

    z-index: 40;

    text-align: center;
}


#game-over .box {

    background: #151922;

    border:
        1px solid rgba(255,255,255,.12);

    border-radius: 18px;

    padding: 35px;

    min-width: 280px;
}


#game-over h1 {

    margin-top: 0;
}


button {

    border: 0;

    border-radius: 10px;

    padding: 12px 22px;

    font-weight: bold;

    cursor: pointer;
}
