@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&display=swap');
html {
background-color: #232433;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 200 200'%3E%3Cdefs%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='100' y1='33' x2='100' y2='-3'%3E%3Cstop offset='0' stop-color='%23000' stop-opacity='0'/%3E%3Cstop offset='1' stop-color='%23000' stop-opacity='1'/%3E%3C/linearGradient%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='100' y1='135' x2='100' y2='97'%3E%3Cstop offset='0' stop-color='%23000' stop-opacity='0'/%3E%3Cstop offset='1' stop-color='%23000' stop-opacity='1'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='%23333653' fill-opacity='0.6'%3E%3Crect x='100' width='100' height='100'/%3E%3Crect y='100' width='100' height='100'/%3E%3C/g%3E%3Cg fill-opacity='0.5'%3E%3Cpolygon fill='url(%23a)' points='100 30 0 0 200 0'/%3E%3Cpolygon fill='url(%23b)' points='100 100 0 130 0 100 200 100 200 130'/%3E%3C/g%3E%3C/svg%3E");
}

body, html {
    display: flex;
    height: 100%;
    justify-content: center;
    margin: 0;
    font-family: 'Roboto Mono', monospace;
    color: #cbd5e1;

}

.canvas-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;


}

canvas {
    background-image: url("../assets/images/bg1.png");;
     image-rendering: pixelated;
    cursor: url("../assets/images/crosshair.png") 15 15, auto;
}
.username-container {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#usernameInput {
    padding: 12px;
    border-radius: 20px;
    border: none;
    background: #475569;
    color: #cbd5e1;
    margin-bottom: 8px;
}

#name-input-button {
    padding: 8px 20px;
    border-radius: 100px;
    border: none;
    background-image: linear-gradient(to right, rgb(6, 182, 212), rgb(59, 130, 246));
    color: white;
    cursor: pointer;
}

#leaderboard-title {
    font-size: 1.2em;
    margin-bottom: 10px;
}

#score-div {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 10px;
    background-color: rgba(26, 26, 46, 0.48);
    margin-bottom: 20px;
}

#score-list {
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 320px;
    width: 400px;
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: rgba(26, 26, 46, 0.9);
    border: 2px solid #4a4e69;
    box-shadow: 0 0 10px rgba(74, 78, 105, 0.5);
    z-index: 1;
    max-width: 90%;
    max-height: 80vh;
    border-radius: 10px;
    overflow: hidden;
    animation: chat-appear 0.5s ease-out;
}

@keyframes chat-appear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    scrollbar-width: thin;
    scrollbar-color: #4a4e69 #1a1a2e;
    display: flex;
    flex-direction: column;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #1a1a2e;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: #4a4e69;
    border-radius: 2px;
}

.message {
    max-width: 80%;
    margin-bottom: 8px;
    padding: 8px;
    border-radius: 5px;
    font-size: 0.9em;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
    animation: message-appear 0.3s ease-out;
    flex-shrink: 0;
}

@keyframes message-appear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #4a4e69, transparent);
}

.timestamp {
    font-size: 0.7em;
    color: #9a9ab0;
    margin-top: 4px;
    display: block;
}

.user-message {
    background-color: rgba(74, 78, 105, 0.2);
    border-left: 2px solid #4a4e69;
    align-self: flex-end;
    border-bottom-right-radius: 0;
    animation: send-message 0.3s ease-out;
}

@keyframes send-message {
    0% {
        opacity: 0;
        transform: translateX(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.other-message {
    background-color: rgba(95, 75, 109, 0.2);
    border-right: 2px solid #5f4b6d;
    align-self: flex-start;
    border-bottom-left-radius: 0;
    animation: receive-message 0.3s ease-out;
}

@keyframes receive-message {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.bot-message {
    font-size: 0.8em;
    background-color: rgba(14, 11, 12, 0.2);
    border-right: 2px solid #4e6766;
    align-self: flex-start;
    border-bottom-left-radius: 0;
    animation: receive-message 0.3s ease-out;
}

.chat-input,
.join-input {
    display: flex;
    padding: 10px;
    background-color: rgba(74, 78, 105, 0.1);
}

#message-input,
#join-input {
    flex: 1;
    padding: 8px;
    background-color: rgba(26, 26, 46, 0.8);
    color: #e0e0e0;
    border: 1px solid #4a4e69;
    border-radius: 5px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

#join-button,
#send-button {
    padding: 8px 16px;
    background-color: #4a4e69;
    color: #e0e0e0;
    border: none;
    margin-left: 8px;
    cursor: pointer;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9em;
    border-radius: 5px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#join-button:hover,
#send-button:hover {
    background-color: #5f4b6d;
}

#join-button::after,
#send-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}


@keyframes subtle-glow {
    0% {
        box-shadow: 0 0 5px rgba(74, 78, 105, 0.3);
    }
    50% {
        box-shadow: 0 0 10px rgba(74, 78, 105, 0.5);
    }
    100% {
        box-shadow: 0 0 5px rgba(74, 78, 105, 0.3);
    }
}

.chat-container {
    animation: subtle-glow 4s infinite;
}

@keyframes focus-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(95, 75, 109, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(95, 75, 109, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(95, 75, 109, 0);
    }
}

#message-input:focus,
#join-input:focus {
    outline: none;
    border-color: #5f4b6d;
    box-shadow: 0 0 5px rgba(95, 75, 109, 0.5);
}

#join-input:focus {
    animation: focus-pulse 1s infinite;
}

