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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #111;
    font-family: Arial, sans-serif;
}

canvas {
    display: block;
}

#game {
    width: 100vw;
    height: 100vh;
}

#minimap {
    position: absolute;
    right: 16px;
    bottom: 16px;
    width: 180px;
    height: 180px;
    border: 2px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.35);
    border-radius: 10px;
}

#menu,
#deathScreen {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.82);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 18px;
    z-index: 10;
}

#menu h1 {
    color: white;
    font-size: 52px;
    text-shadow: 0 0 18px #00ff99;
}

#playerName {
    width: 300px;
    padding: 12px 16px;
    border-radius: 999px;
    border: 2px solid #23c16b;
    background: #1a1a1a;
    color: white;
    text-align: center;
    font-size: 20px;
    outline: none;
}

#skins {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: min(92vw, 420px);
    justify-content: center;
}

.skin {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    border: 2px solid rgba(255,255,255,0.18);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 18px rgba(255,255,255,0.12), 0 8px 20px rgba(0,0,0,0.35);
}

.skin.selected {
    border-color: rgba(255,255,255,0.9);
    box-shadow: 0 0 20px rgba(255,255,255,0.5), 0 10px 22px rgba(0,0,0,0.45);
}

.skin::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.22), rgba(255,255,255,0));
}

.skin-tag {
    position: absolute;
    right: 6px;
    bottom: 6px;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    padding: 0 6px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

button {
    padding: 14px 36px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(45deg, #16c76c, #0d8f4a);
    color: white;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

#hud {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

#scoreBox {
    position: absolute;
    left: 16px;
    top: 16px;
    color: white;
    font-size: 24px;
    font-weight: bold;
}

#leaderboard {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 220px;
    background: rgba(0,0,0,0.45);
    border-radius: 10px;
    padding: 14px;
    color: white;
}

#leaderboard h3 {
    text-align: center;
    color: #5dff9e;
    margin-bottom: 8px;
}

#leaderboardList {
    padding-left: 18px;
    font-size: 14px;
}

#leaderboardList li {
    margin-bottom: 5px;
}

.me-rank {
    color: #ffd45b;
    font-weight: bold;
}

.death-card {
    background: rgba(18,18,18,0.94);
    padding: 28px;
    border-radius: 16px;
    color: white;
    min-width: 320px;
    text-align: center;
}

.death-card h2 {
    color: #ff6666;
    margin-bottom: 12px;
}
