@import url('https://fonts.googleapis.com/css2?family=Creepster&family=Luckiest+Guy&family=Nosifer&family=Roboto:wght@400;700&display=swap');

body { 
    margin: 0; 
    background-color: #313338; 
    
    background-image: 
        linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), 
        url('images/background.jpg'); 
        
    background-size: cover; 
    background-position: center;
    background-attachment: fixed;
    
    color: #dbdee1; 
    font-family: 'Luckiest Guy', cursive;
    overflow: hidden; 
    user-select: none;
}

canvas { display: block; cursor: crosshair; }
.hidden { display: none !important; }

.version-tag {
    position: absolute;
    top: 10px; right: 15px;
    font-family: 'Roboto', sans-serif;
    color: #5865f2;
    font-weight: bold;
    font-size: 16px;
}

#ui-layer { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    pointer-events: none; 
}

#boss-hp-container {
    position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
    width: 600px; height: 35px; 
    background: #111214; 
    border: 3px solid #000;
    border-radius: 20px; 
    overflow: hidden; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

#boss-hp-bar { 
    width: 100%; height: 100%; 
    background: linear-gradient(90deg, #ed4245, #ff797c); 
    transition: width 0.3s ease; 
}

#boss-name { 
    position: absolute; top: 5px; width: 100%; 
    text-align: center; font-size: 22px; 
    color: #fff; letter-spacing: 1px;
    text-shadow: 2px 2px 0 #000; 
}

#stats-container { 
    position: absolute; top: 20px; right: 20px; 
    text-align: right; 
    font-family: 'Roboto', sans-serif; 
}

.stat-box { 
    font-size: 18px; margin-bottom: 5px; color: #f2f3f5; font-weight: bold; 
    background: rgba(0,0,0,0.6); padding: 8px 15px; border-radius: 20px; 
    border: 1px solid rgba(255,255,255,0.1);
}
#money-display span { color: #fee75c; } 

#menu-container { 
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); 
    width: 600px; 
    background-color: #313338; 
    border-radius: 30px; 
    border: 2px solid #404249; 
    padding: 40px; 
    text-align: center; 
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    pointer-events: auto;
    z-index: 100;
}

.header-wrapper {
    display: flex; align-items: center; justify-content: center;
    gap: 20px; margin-bottom: 30px;
}

.game-logo {
    width: 90px; height: auto;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.5));
    animation: floatBounce 3s ease-in-out infinite;
}

@keyframes floatBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px) rotate(3deg); }
}

.titles-block { display: flex; flex-direction: column; align-items: flex-start; }

h1 { 
    font-family: 'Luckiest Guy', cursive;
    font-size: 55px; margin: 0; line-height: 0.9;
    background: linear-gradient(to bottom, #f1c40f, #e67e22);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(4px 4px 0px #000);
    transform: rotate(-3deg);
}

.subtitle {
    font-family: 'Nosifer', cursive; 
    font-size: 24px;
    color: #4d7fec; 
    text-shadow: 2px 2px 0px #197cd8, 0px 0px 10px rgba(70, 132, 247, 0.6);
    margin-top: 10px;
    margin-left: 10px;
    transform: rotate(2deg);
}

input[type=text] { 
    padding: 15px; width: 80%; 
    background: #1e1f22; 
    border: 2px solid #1e1f22; 
    border-radius: 25px; 
    color: #dbdee1; 
    font-family: 'Roboto', sans-serif; 
    font-size: 18px;
    text-align: center; 
    outline: none;
    margin-bottom: 25px;
    transition: 0.2s;
}
input[type=text]::placeholder { color: #87898c; }
input[type=text]:focus { border-color: #5865f2; background: #2b2d31; }

button.main-btn { 
    display: block; width: 70%; margin: 10px auto; padding: 15px; 
    background-color: #5865f2; 
    color: white; border: none; 
    border-radius: 50px; 
    font-family: 'Luckiest Guy', cursive; 
    font-size: 24px; letter-spacing: 1px;
    cursor: pointer; transition: all 0.2s ease;
    box-shadow: 0 5px 0 #3c45a5;
}

button.main-btn:hover { background-color: #4752c4; transform: translateY(-2px); box-shadow: 0 7px 0 #3c45a5; }
button.main-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #3c45a5; }

button.join-btn { background-color: #248046; box-shadow: 0 5px 0 #15562b; }
button.join-btn:hover { background-color: #1a6334; box-shadow: 0 7px 0 #15562b; }
button.join-btn:active { box-shadow: 0 2px 0 #15562b; }

.avatar-grid { 
    display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; margin: 20px 0; 
    background: rgba(0,0,0,0.2); padding: 20px; border-radius: 20px;
}

.avatar-opt { 
    width: 65px; height: 65px; 
    border-radius: 50%; border: 3px solid #313338; 
    background: #1e1f22; cursor: pointer; transition: 0.2s; object-fit: cover;
}
.avatar-opt:hover { transform: scale(1.1); }
.avatar-opt.selected { 
    border-color: #f1c40f; 
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.4);
    transform: scale(1.15);
}
.avatar-opt[data-role="mole"] { border-color: #ed4245; } 

#shop-modal {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: #313338; border-radius: 15px; 
    padding: 25px; width: 450px; text-align: left; pointer-events: auto; z-index: 50;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); border: 1px solid #404249;
}
#shop-modal h2 {
    color: #f1c40f; font-family: 'Luckiest Guy', cursive; font-size: 35px;
    margin: 0 0 20px 0; text-align: center; text-shadow: 2px 2px 0 #000;
}

#player-stats-display {
    background: #1e1f22;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-family: 'Roboto', sans-serif;
    color: #fff;
    font-weight: bold;
    text-align: center;
    border: 1px solid #444;
}

.shop-item {
    display: flex; justify-content: space-between; align-items: center;
    background: #2b2d31; margin: 10px 0; padding: 12px;
    border-radius: 10px; font-family: 'Roboto', sans-serif; color: #dbdee1; font-size: 16px;
}
.shop-btn {
    background: #5865f2; color: #fff; border: none; padding: 8px 15px; 
    font-weight: bold; font-size: 14px; border-radius: 20px; cursor: pointer;
}
.shop-btn:hover { background-color: #4752c4; }

#role-description {
    font-family: 'Roboto', sans-serif; color: #949ba4;
    margin-top: 10px; font-size: 15px; font-weight: bold;
}

#wave-message {
    position: absolute;
    top: 30%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Nosifer', cursive;
    font-size: 80px;
    color: #ff0000;
    text-shadow: 0 0 20px #000;
    z-index: 200;
    pointer-events: none;
    animation: waveAnim 4s ease-in-out forwards;
}

@keyframes waveAnim {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

#death-screen {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(50, 0, 0, 0.9); 
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    z-index: 9999;
    pointer-events: auto;
}

.death-title {
    font-family: 'Nosifer', cursive;
    font-size: 100px;
    color: #ff0000;
    text-shadow: 4px 4px 0 #000, 0 0 30px #ff0000;
    animation: pulseDeath 2s infinite;
}

.death-subtitle {
    font-family: 'Creepster', cursive;
    font-size: 40px;
    color: #fff;
    margin-top: 20px;
}

@keyframes pulseDeath {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}