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

body { 
    background:#0a0a0f;
    display:flex; 
    align-items:center; 
    justify-content:center; 
    height:100vh; 
    overflow:hidden; 
    font-family:'Courier New',monospace; 
}

#wrap { 
    position:relative; 
    width:800px; 
    height:600px; 
}
canvas { 
    display:block; 
    image-rendering:pixelated; 
    border:2px solid #222; 
}

/* HUD */
#hud { 
    position:absolute; 
    top:0; 
    left:0; 
    width:800px; 
    height:42px; 
    background:rgba(0,0,0,0.85); 
    display:flex; 
    align-items:center; 
    z-index:10; 
    pointer-events:none; 
    border-bottom:1px solid #1a1a2a; 
}

.hud-seg { 
    display:flex; 
    align-items:center; 
    gap:6px; 
    padding:0 12px; 
    border-right:1px solid #1a1a2a; 
    height:100%; 
}

.hud-label { 
    color:#555; 
    font-size:9px; 
    letter-spacing:1px; 
    text-transform:uppercase; 
}
.hud-val { 
    color:#f0e040; 
    font-size:13px; 
    font-weight:bold; 
}

#hud-hp-bar { 
    width:70px; 
    height:8px; 
    background:#300; 
    border:1px solid #500; 
}
#hud-hp-fill { 
    height:100%; 
    background:linear-gradient(90deg,#e03030,#f06030); 
    transition:width 0.2s; 
}
#hud-en-bar { 
    width:65px; 
    height:8px; 
    background:#010; 
    border:1px solid #030; 
}
#hud-en-fill { 
    height:100%; 
    background:linear-gradient(90deg,#20b050,#50f090); 
    transition:width 0.08s; 
}

/* Alert bar */
#alert-bar { 
    position:absolute; 
    top:48px; 
    left:0; 
    width:800px; 
    text-align:center; 
    z-index:15; 
    pointer-events:none; 
}
.amsg { 
    display:inline-block; 
    background:#bb1010; 
    color:#fff; 
    font-size:13px; 
    font-weight:bold; 
    padding:4px 18px; 
    letter-spacing:3px; 
    opacity:0; 
    transition:opacity 0.15s; 
}
.amsg.show { 
    opacity:1; 
}

/* Hit flash */
#hit-flash { 
    position:absolute; 
    top:0; 
    left:0; 
    width:800px; 
    height:600px; 
    background:transparent; 
    pointer-events:none; 
    z-index:18; 
    transition:background 0.06s; 
}

/* Screens */
.screen { 
    position:absolute; 
    top:0; 
    left:0; 
    width:800px; 
    height:600px; 
    display:none; 
    flex-direction:column; 
    align-items:center; 
    justify-content:center; 
    background:rgba(4,4,12,0.94); 
    z-index:20; 
}
.screen.active { 
    display:flex; 
}
.screen h1 { 
    color:#f0e040; 
    font-size:36px; 
    letter-spacing:4px; 
    margin-bottom:6px; 
    text-shadow:0 0 22px #f0e04055; 
}
.screen h2 { 
    color:#f0e040; 
    font-size:22px; 
    letter-spacing:3px; 
    margin-bottom:14px; 
}

.screen p { 
    color:#777; 
    font-size:12px; 
    margin-bottom:18px; 
    text-align:center; 
    max-width:480px; 
    line-height:1.7; }
.btn { 
    background:#f0e040; 
    color:#000; 
    border:none; 
    padding:11px 34px; 
    font-size:15px; 
    font-family:'Courier New',monospace; 
    font-weight:bold; 
    cursor:pointer; 
    letter-spacing:2px; 
    margin:4px; 
    transition:all 0.11s;
}
.btn:hover { 
    background:#fff; 
    transform:scale(1.04); 
}
.btn.sec { 
    background:transparent; 
    color:#f0e040; 
    border:2px solid #f0e040; 
}
.btn.sec:hover { 
    background:#f0e04015; 
}

#name-input { 
    background:#0d0d1e; 
    border:2px solid #f0e040; 
    color:#fff; 
    font-size:19px; 
    font-family:'Courier New',monospace; 
    padding:9px 16px; 
    margin:10px; 
    text-align:center; 
    outline:none; 
    width:250px; 
}


/* Leaderboard */
#lb-list { 
    width:460px; 
    max-height:280px; 
    overflow-y:auto; 
    margin:8px 0; 
}

.lb-row { 
    display:flex; 
    align-items:center; 
    padding:7px 12px; 
    border-bottom:1px solid #111;
}
.lb-row.me { 
    background:#0a1a0a; 
    border-left:3px solid #40f090; 
}
.lb-rank { 
    color:#f0e040; 
    width:32px; 
    font-size:12px; 
    font-weight:bold; 
}
.lb-name { 
    flex:1; color:#ccc; font-size:12px; 
}
.lb-gems { 
    color:#80e8ff; 
    font-size:13px; 
    font-weight:bold; 
}
.lb-lvl  { 
    color:#666; 
    font-size:10px; 
    margin-left:8px; 
}

/* Result */
.stars { 
    font-size:28px; 
    margin:7px 0; 
    letter-spacing:5px; 
}
.rinfo { 
    color:#aaa; 
    font-size:12px; 
    margin:3px 0; 
}