* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

body {
    background-color: #030508;
    background-image: 
        radial-gradient(circle at 50% 30%, #150f22 0%, transparent 70%),
        linear-gradient(rgba(0, 210, 211, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 210, 211, 0.015) 1px, transparent 1px);
    background-size: 100% 100%, 30px 30px, 30px 30px;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
    padding: 6px;
}

.overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: radial-gradient(circle at center, rgba(8, 11, 20, 0.98) 0%, rgba(2, 3, 6, 0.99) 100%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #f1f2f6;
    padding: 24px;
    backdrop-filter: blur(5px);
}

.hidden { display: none !important; }
.neonText { font-size: 28px; color: #00d2d3; text-shadow: 0 0 10px #00d2d3, 0 0 25px rgba(0,210,211,0.5); letter-spacing: 2px; margin-bottom: 12px; }
.redNeonText { font-size: 28px; color: #ff4757; text-shadow: 0 0 10px #ff4757, 0 0 25px rgba(255,71,87,0.5); letter-spacing: 2px; margin-bottom: 12px; }
.overlay p { font-size: 13px; color: #8e9bb0; margin-bottom: 24px; max-width: 300px; line-height: 1.5; }

.actionBtn {
    background: linear-gradient(135deg, #00d2d3 0%, #00a8ff 100%); color: #030508; border: none; padding: 14px 45px; font-size: 16px; font-weight: bold; border-radius: 30px; cursor: pointer; box-shadow: 0 0 20px rgba(0, 210, 211, 0.4); transition: transform 0.1s;
}
.actionBtn:active { transform: scale(0.95); }
.redBtn { background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%); box-shadow: 0 0 20px rgba(255, 71, 87, 0.4); }

#topHeader { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 450px; margin-bottom: 4px; }
#floorTitle { color: #ff4757; font-size: 14px; letter-spacing: 1px; text-shadow: 0 0 8px rgba(255, 71, 87, 0.3); }
#pauseBtn { background: rgba(255, 215, 0, 0.05); color: #ffd700; border: 1.5px solid rgba(255, 215, 0, 0.3); padding: 3px 12px; font-size: 11px; font-weight: bold; border-radius: 6px; cursor: pointer; }

#classTitle { color: #eccc68; font-size: 12px; margin-bottom: 4px; text-transform: uppercase; text-align: center; letter-spacing: 1px; }
#gameUi { color: #f1f2f6; font-size: 12px; margin-bottom: 4px; text-align: center; width: 100%; max-width: 450px; display: flex; justify-content: space-between; }
#recordUi { color: #4b5563; font-size: 11px; margin-bottom: 5px; text-align: center; width: 100%; max-width: 450px; }

/* NUOVO INVENTARIO DIGITALE EVOLUTO (Glassmorphism + Neon Slots) */
#equipUi { 
    width: 100%; max-width: 450px; margin-bottom: 8px;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
#equipUi div {
    background: rgba(15, 23, 42, 0.5);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px; padding: 6px 4px; font-size: 10px; text-align: center;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* Classi CSS per gestire i Gradi di Rarità dell'Inventario */
.rarity-comune { border-color: rgba(164, 176, 190, 0.3) !important; color: #a4b0be !important; }
.rarity-raro { border-color: rgba(0, 210, 211, 0.4) !important; color: #00d2d3 !important; box-shadow: inset 0 0 8px rgba(0, 210, 211, 0.1) !important; }
.rarity-epico { border-color: rgba(155, 89, 182, 0.5) !important; color: #9b59b6 !important; box-shadow: inset 0 0 10px rgba(155, 89, 182, 0.15) !important; }
.rarity-leggendario { border-color: rgba(254, 202, 87, 0.6) !important; color: #feca57 !important; box-shadow: 0 0 12px rgba(254, 202, 87, 0.2), inset 0 0 10px rgba(254, 202, 87, 0.2) !important; }

#canvasContainer { width: 100%; max-width: 450px; display: flex; flex-direction: column; gap: 4px; position: relative; }
canvas { background-color: #040609; border: 2.5px solid #1e293b; display: block; width: 100%; max-height: 36vh; box-shadow: 0px 10px 30px rgba(0,0,0,0.6); }

#hpBarContainer { width: 100%; height: 6px; background-color: #090d16; border: 1.5px solid #1e293b; border-bottom: none; border-radius: 6px 6px 0 0; overflow: hidden; }
#hpBarFill { width: 100%; height: 100%; background-color: #2ed573; box-shadow: 0 0 10px #2ed573; transition: width 0.15s ease-out; }
#expBarContainer { width: 100%; height: 6px; background-color: #090d16; border: 1.5px solid #1e293b; border-top: none; border-radius: 0 0 6px 6px; overflow: hidden; }
#expBarFill { width: 0%; height: 100%; background-color: #00d2d3; box-shadow: 0 0 10px #00d2d3; transition: width 0.2s ease-out; }

#shopUi { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; width: 100%; max-width: 450px; margin-top: 6px; }
.shopBtn { background: rgba(9, 13, 22, 0.7); color: #f1f2f6; border: 1.5px solid #1e293b; padding: 6px; font-size: 11px; font-weight: bold; border-radius: 8px; }
.shopBtn:active { border-color: #00d2d3; background-color: #121824; }
.price { color: #eccc68; font-size: 10px; }

#mobileControlsArea { width: 100%; max-width: 450px; height: 110px; margin-top: 8px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
#joystickZone { flex: 1; height: 100%; background: rgba(9, 13, 22, 0.4); border-radius: 12px; border: 1.5px dashed rgba(0, 210, 211, 0.12); position: relative; touch-action: none; }
#actionZone { width: 95px; height: 100%; display: flex; align-items: center; justify-content: center; }
#btnSkill { width: 66px; height: 66px; border-radius: 50%; background: radial-gradient(circle at center, #072a30 0%, #031317 100%); border: 3px solid #1289a7; color: #00d2d3; font-size: 13px; font-weight: bold; box-shadow: 0 4px 15px rgba(0,0,0,0.5); touch-action: manipulation; }
#btnSkill:active { transform: scale(0.94); background: #1289a7; color: #fff; box-shadow: 0 0 15px #00d2d3; }
