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

body {
    font-family: 'Arial', sans-serif;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.screen.active {
    display: flex;
}

#nameEntry {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    color: white;
    text-align: center;
    background: transparent;
    pointer-events: auto;
}

#nameEntry h1,
#nameEntry p,
#nameEntry input,
#nameEntry button {
    pointer-events: auto;
}

#nameEntry h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
}

#nameEntry p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

#nameInput {
    width: 300px;
    padding: 15px 20px;
    font-size: 1.2rem;
    border: none;
    border-radius: 10px;
    margin-bottom: 1rem;
    text-align: center;
    outline: none;
}

#nameInput:focus {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.3);
}

button {
    background: white;
    color: #667eea;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

button:active {
    transform: translateY(0);
}

#waitingMsg {
    margin-top: 2rem;
    color: white;
}

.spinner {
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 1rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#gameScreen {
    position: relative;
}

#gameUI {
    position: absolute;
    top: 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    z-index: 10;
    pointer-events: none;
}

#timer {
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: bold;
}

#score {
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px 30px;
    border-radius: 10px;
    font-size: 2rem;
    font-weight: bold;
}

.separator {
    margin: 0 15px;
}

#boostBar {
    background: rgba(0,0,0,0.7);
    width: 200px;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    display: none;
}

#boostFill {
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
    height: 100%;
    width: 100%;
    transition: width 0.1s;
}

#gameCanvas {
    background: #1a1a2e;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

#endScreen {
    color: white;
    text-align: center;
}

#endScreen h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

#finalScore {
    font-size: 2rem;
    margin-bottom: 2rem;
}

#lobbyScreen {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#lobbyCanvas {
    display: block;
}

#chat {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 298px;
    background: transparent;
    border-radius: 0;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

body:has(#nameEntry.active) #chat {
    display: none;
}

#chatMessages {
    height: 200px;
    overflow-y: auto;
    padding: 10px;
    color: white;
    font-size: 0.9rem;
    scroll-behavior: smooth;
    pointer-events: none;
}

#chatMessages::-webkit-scrollbar {
    width: 6px;
}

#chatMessages::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

#chatMessages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.chat-message {
    margin-bottom: 5px;
    word-wrap: break-word;
}

.chat-player {
    font-weight: bold;
    color: #667eea;
}

.chat-text {
    color: #ddd;
}

.chat-system {
    color: #aaa;
    font-style: italic;
}

#chatInput {
    border: none;
    pointer-events: auto;
}

#chatBox {
    width: 100%;
    padding: 10px;
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    font-size: 0.9rem;
    outline: none;
    border-radius: 0;
}

#chatBox::placeholder {
    color: rgba(255,255,255,0.5);
}

/* Settings Button */
/* Icon buttons (settings, profile, leaderboard) */
.icon-btn {
    position: absolute;
    top: 20px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    max-width: 50px;
    max-height: 50px;
    border-radius: 10px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: none; /* Hidden for guests by default */
    padding: 0;
    line-height: 50px;
    text-align: center;
}

.icon-btn:hover {
    background: rgba(0,0,0,0.9);
    transform: scale(1.1);
}

.icon-btn.active {
    display: block;
}

#settingsBtn {
    right: 20px;
    display: block; /* Always visible */
}

#viewLeaderboardBtn {
    right: 80px; /* 50px button + 10px gap */
}

#viewProfileBtn {
    right: 140px; /* 50px + 10px + 50px + 10px */
}

#viewCosmeticsBtn {
    right: 200px; /* 50px + 10px + 50px + 10px + 50px + 10px */
}

/* Lobby Leaderboard */
.lobby-leaderboard {
    position: absolute;
    top: 80px;
    right: 20px;
    width: 200px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    padding: 10px;
    color: white;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    max-height: calc(100vh - 110px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lobby-leaderboard-title {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 6px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lobby-leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    max-height: 400px;
}

.lobby-leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
}

.lobby-leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-2px);
}

.lobby-leaderboard-item.current-player {
    background: rgba(100, 149, 237, 0.3);
    border: 1px solid rgba(100, 149, 237, 0.5);
}

.lobby-leaderboard-item.rank-1 .lobby-player-name {
    color: #FFD700;
    font-weight: bold;
}

.lobby-leaderboard-item.rank-2 .lobby-player-name {
    color: #C0C0C0;
    font-weight: bold;
}

.lobby-leaderboard-item.rank-3 .lobby-player-name {
    color: #CD7F32;
    font-weight: bold;
}

.lobby-player-name {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.lobby-player-elo {
    font-size: 12px;
    opacity: 0.8;
    font-weight: bold;
}

.lobby-player-guest {
    font-size: 11px;
    opacity: 0.6;
    font-style: italic;
}

/* Settings Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #1E1E24;
    border: 1px solid #3A3F4A;
    border-radius: 12px;
    width: 900px;
    max-width: 95%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.9);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: #252935;
    border-bottom: 1px solid #3A3F4A;
}

.modal-header h2 {
    color: white;
    font-size: 2rem;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.4);
}

.close-btn {
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.close-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.modal-body {
    padding: 15px;
    background: #1E1E24;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-body h3 {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 20px;
    margin-top: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.4);
}

/* Settings Columns Layout */
.settings-columns {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.settings-column {
    flex: 1;
    min-width: 0;
}

.settings-column:first-child {
    border-right: 1px solid #3A3F4A;
    padding-right: 40px;
}

/* Key Bindings */
.key-bindings {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.binding-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.binding-row label {
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
}

.key-bind-btn {
    background: #2A2D35;
    color: white;
    border: 1px solid #3A3F4A;
    padding: 10px 30px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 120px;
}

.key-bind-btn:hover {
    background: #4A9EFF;
    border-color: #4A9EFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74,158,255,0.3);
}

.key-bind-btn.listening {
    background: rgba(245,87,108,0.3);
    color: white;
    border-color: #f5576c;
    animation: pulse 1s infinite;
    box-shadow: 0 0 20px rgba(245,87,108,0.4);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

.reset-btn {
    width: 100%;
    background: #2A2D35;
    color: white;
    border: 1px solid #3A3F4A;
    padding: 12px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.reset-btn:hover {
    background: #4A9EFF;
    border-color: #4A9EFF;
    transform: translateY(-2px);
}

/* Controls Overlay */
.controls-overlay {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    animation: slideUp 0.3s ease-out;
    transition: opacity 0.5s ease;
}

.controls-overlay.active {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.controls-content {
    background: rgba(26, 26, 46, 0.98);
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 22px 30px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
    position: relative;
    max-width: 750px;
    transform: scale(0.75);
    transform-origin: center bottom;
}

.controls-content h2 {
    color: white;
    font-size: 2rem;
    margin: 0 0 25px 0;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.controls-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.controls-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.control-schemes {
    display: flex;
    gap: 40px;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
}

.control-schemes::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 20%,
        rgba(255, 255, 255, 0.3) 80%,
        rgba(255, 255, 255, 0) 100%);
    transform: translateX(-50%);
}

.control-schemes::after {
    content: 'OR';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(26, 26, 46, 0.98);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.control-scheme {
    flex: 1;
    padding: 0 20px;
    position: relative;
}

.scheme-checkmark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 120px;
    color: #4CAF50;
    font-weight: bold;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    text-shadow: 0 0 20px rgba(76, 175, 80, 0.8);
    transition: opacity 0.3s ease;
}

.control-scheme.completed .scheme-checkmark {
    opacity: 1;
}

.key-group {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.key-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
}

.key-row {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.key-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.keyboard-key {
    background: linear-gradient(180deg, #f5f5f5 0%, #e0e0e0 100%);
    border: 2px solid #999;
    border-radius: 8px;
    box-shadow: 0 4px 0 #666, 0 5px 10px rgba(0,0,0,0.3);
    color: #333;
    font-size: 1.2rem;
    font-weight: bold;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
    user-select: none;
}

.keyboard-key:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #666, 0 3px 5px rgba(0,0,0,0.3);
}

.keyboard-key.pressed {
    background: linear-gradient(180deg, #4CAF50 0%, #388E3C 100%);
    border-color: #2E7D32;
    box-shadow: 0 4px 0 #1B5E20, 0 5px 10px rgba(0,0,0,0.3);
    color: white;
}

.key-label {
    color: white;
    font-size: 0.85rem;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.controls-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.controls-hint {
    color: #f093fb;
    font-size: 1rem;
    margin: 5px 0;
}

.controls-settings {
    color: #aaa;
    font-size: 0.9rem;
    margin: 5px 0;
}

.controls-hint strong,
.controls-settings strong {
    color: white;
}

/* ===== Auth Screen Styles ===== */
#authScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    color: white;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#authScreen.active {
    display: flex;
}

#authScreen h1 {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#authScreen .subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 1.2rem;
}

.auth-form {
    display: none;
    background: rgba(40, 40, 40, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    margin-bottom: 1rem;
    font-size: 1.8rem;
    color: white;
}

.input-group {
    margin-bottom: 0.8rem;
}

.input-group input {
    width: 100%;
    padding: 0.7rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    box-sizing: border-box;
    transition: all 0.3s;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-group input:focus {
    outline: none;
    border-color: #4a9eff;
    background: rgba(255, 255, 255, 0.15);
}

.error-message {
    color: #ff6b6b;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    min-height: 18px;
    text-align: center;
}

.primary-btn, .secondary-btn, .guest-btn {
    width: 100%;
    padding: 0.7rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 0.5rem;
}

.primary-btn {
    background: #4a9eff;
    color: white;
}

.primary-btn:hover {
    background: #357abd;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.4);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.guest-btn {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.guest-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.guest-info {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-bottom: 0.6rem;
    text-align: center;
}

/* New auth layout sections */
.auth-section {
    margin-bottom: 0.8rem;
}

.guest-section {
    padding-bottom: 0;
}

.account-section {
    padding-top: 0;
}

.auth-divider {
    text-align: center;
    position: relative;
    margin: 1rem 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.auth-divider span {
    position: relative;
    background: transparent;
    padding: 0 1rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.guest-info-inline {
    font-size: 0.85rem;
    opacity: 0.7;
    text-align: center;
    margin-top: 0.3rem;
    margin-bottom: 0;
    color: white;
}

.guest-play-btn {
    width: 100%;
    margin-bottom: 0.3rem;
}

/* ===== Stats Panel in Lobby ===== */
/* Stats display (ELO and record) - positioned left of profile button */
.stats-display {
    position: absolute;
    top: 20px;
    right: 270px; /* Left of cosmetics button */
    background: rgba(0, 0, 0, 0.5);
    border-radius: 25px;
    padding: 0 20px;
    color: white;
    display: none; /* Hidden for guests */
    z-index: 2;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    height: 50px;
    gap: 20px;
    align-items: center;
}

.stats-display.active {
    display: flex;
}

/* Guest login message */
.guest-login-message {
    position: absolute;
    top: 20px;
    right: 75px; /* Close to settings button */
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 0 20px;
    color: white;
    display: none; /* Hidden for logged-in users */
    z-index: 2;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    height: 50px;
    gap: 10px;
    align-items: center;
}

.guest-login-message.active {
    display: flex;
}

.guest-login-btn {
    background: #4A9EFF;
    color: white;
    border: none;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.4);
}

.guest-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.6);
}

.guest-login-btn:active {
    transform: translateY(0);
}

.guest-message-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
}

.stats-text {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.9);
}

#playerElo {
    color: #ffd700;
    font-weight: bold;
}

#playerRecord {
    color: white;
    font-weight: bold;
}

/* ===== Profile and Leaderboard Modals ===== */
.modal-content.large {
    width: 440px;
    max-width: 95%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Friends modal - fixed top position so it doesn't jump when switching tabs */
#friendsModal {
    align-items: flex-start;
    padding-top: 80px;
}

#friendsModal .friends-list-container {
    min-height: 350px;
}

/* Leaderboard modal - fixed top position */
#leaderboardModal {
    align-items: flex-start;
    padding-top: 80px;
}

#leaderboardModal .leaderboard-list {
    min-height: 350px;
}

/* Quests modal - fixed top position */
#questsModal {
    align-items: flex-start;
    padding-top: 80px;
}

#questsModal .quest-list {
    min-height: 300px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-box {
    background: #2A2D35;
    border: 1px solid #3A3F4A;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
}

.stat-box:hover {
    background: #2F3340;
    border-color: #4A9EFF;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #4A9EFF;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: white;
    opacity: 0.8;
}

.stat-sublabel {
    font-size: 12px;
    color: white;
    opacity: 0.6;
    margin-top: 5px;
}

/* ===== Achievements ===== */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.achievement-item {
    background: #2A2D35;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid #3A3F4A;
    transition: all 0.3s;
}

.achievement-item.unlocked {
    background: #2F3340;
    border-color: #4A9EFF;
}

.achievement-item.locked {
    opacity: 0.5;
}

.achievement-item-icon {
    font-size: 32px;
}

.achievement-item-info {
    flex: 1;
}

.achievement-item-name {
    font-weight: bold;
    color: white;
    margin-bottom: 5px;
}

.achievement-item-desc {
    font-size: 12px;
    color: white;
    opacity: 0.8;
    margin-bottom: 5px;
}

.achievement-progress {
    font-size: 11px;
    color: #4A9EFF;
}

/* ===== Matches List ===== */
.matches-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.match-item {
    background: #2A2D35;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #3A3F4A;
    transition: all 0.3s;
}

.match-item:hover {
    background: #2F3340;
    border-color: #4A9EFF;
}

.match-item.win {
    border-left: 4px solid #4caf50;
}

.match-item.loss {
    border-left: 4px solid #f44336;
}

.match-item.draw {
    border-left: 4px solid #ff9800;
}

.match-info {
    flex: 1;
}

.match-opponent {
    font-weight: bold;
    color: white;
    margin-bottom: 5px;
}

.match-score {
    font-size: 14px;
    color: white;
    opacity: 0.8;
}

.match-elo {
    font-weight: bold;
    font-size: 18px;
}

.match-elo.positive {
    color: #4caf50;
}

.match-elo.negative {
    color: #f44336;
}

/* ===== Leaderboard ===== */
.leaderboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: #2A2D35;
    border: 1px solid #3A3F4A;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    color: rgba(255,255,255,0.7);
}

.tab-btn.active {
    background: #4A9EFF;
    border: 1px solid #4A9EFF;
    color: white;
    font-weight: bold;
}

.tab-btn:hover {
    background: #2F3340;
    border-color: #4A9EFF;
    color: white;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-item {
    background: #2A2D35;
    border: 1px solid #3A3F4A;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s;
}

.leaderboard-item:hover {
    background: #2F3340;
    border-color: #4A9EFF;
}

.leaderboard-rank {
    font-size: 20px;
    font-weight: bold;
    min-width: 40px;
    color: rgba(255,255,255,0.7);
}

.leaderboard-rank.top3 {
    color: #ffd700;
}

.leaderboard-name {
    flex: 1;
    font-weight: bold;
    color: white;
}

.leaderboard-stat {
    font-size: 20px;
    font-weight: bold;
    color: white;
}

/* ===== Achievement Notification ===== */
.achievement-notification {
    position: fixed;
    top: 50%;
    right: -400px;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid #3A3F4A;
    color: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 10000;
    transition: right 0.5s ease;
    min-width: 350px;
}

.achievement-notification.show {
    right: 20px;
}

.achievement-icon {
    font-size: 48px;
}

.achievement-title {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.achievement-name {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 5px;
}

.achievement-desc {
    font-size: 14px;
    opacity: 0.8;
}

/* ===== ELO Change Notification ===== */
.elo-notification {
    position: fixed;
    top: 80px;
    right: 390px;
    transform: scale(0);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 15px;
    text-align: center;
    z-index: 10001;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.elo-notification.show {
    transform: scale(1);
}

.elo-change {
    font-size: 16px;
    font-weight: bold;
}

.elo-change.positive {
    color: #4caf50;
}

.elo-change.negative {
    color: #f44336;
}

.elo-label {
    font-size: 14px;
    opacity: 0.8;
}

/* ===== Ranked Match Indicator ===== */
.ranked-indicator {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: white;
    padding: 10px 25px;
    border-radius: 25px;
    display: none;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.5);
    z-index: 1000;
}

.ranked-indicator.active {
    display: flex;
}

.ranked-icon {
    font-size: 20px;
}

.ranked-text {
    font-size: 16px;
}

/* Ping Display */
.ping-display {
    position: absolute;
    top: 100px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 12px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    display: none;
    z-index: 100;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.ping-display.active {
    display: block;
}

#pingValue {
    color: #4CAF50;
}

#pingValue.yellow {
    color: #FFC107;
}

#pingValue.red {
    color: #F44336;
}

/* Field Info Display */
.field-info-display {
    position: fixed;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-family: 'Arial', sans-serif;
    display: none;
    z-index: 100;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.field-info-display.active {
    display: block;
}

.field-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    gap: 12px;
}

#fieldNumber {
    font-size: 16px;
    font-weight: bold;
}

.game-type {
    font-size: 12px;
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 10px;
}

.player-count-info {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
}

.player-count-info.empty {
    color: rgba(255, 255, 255, 0.5);
}

.player-count-info.waiting {
    color: #FFC107;
}

.player-count-info.full {
    color: #4CAF50;
}

.game-active-info {
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.score-display {
    display: flex;
    align-items: center;
    font-size: 22px;
    font-weight: bold;
    gap: 6px;
}

.score-blue {
    color: #3498db;
}

.score-red {
    color: #e74c3c;
}

.score-separator {
    color: white;
}

.timer-display {
    font-size: 16px;
    font-family: 'Courier New', monospace;
    color: rgba(255, 255, 255, 0.9);
}

/* Display Options */
.display-options {
    margin-bottom: 20px;
}

.option-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.option-row label {
    font-size: 16px;
    color: #fff;
}

/* Mouse Controls Section */
.mouse-controls {
    margin: 10px 0;
}

.control-select {
    padding: 8px 12px;
    font-size: 14px;
    color: #fff;
    background-color: #444;
    border: 2px solid #666;
    border-radius: 5px;
    cursor: pointer;
    outline: none;
}

.control-select:hover {
    border-color: #888;
}

.control-select:focus {
    border-color: #4CAF50;
}

.mouse-controls-info {
    margin-top: 10px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

.mouse-controls-info p {
    font-size: 13px;
    color: #ccc;
    margin: 0;
}

/* Mouse Bindings Section */
.mouse-bindings {
    margin: 10px 0;
}

.mouse-bind-btn {
    min-width: 120px;
}

.mouse-bind-btn.listening {
    background-color: #f39c12;
    border-color: #e67e22;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3A3F4A;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #4CAF50;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-slider:hover {
    background-color: #4A5160;
}

.toggle-switch input:checked + .toggle-slider:hover {
    background-color: #45a049;
}

/* Quick Chat Settings */
.quick-chat-settings {
    margin-top: 10px;
}

.quick-chat-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.quick-chat-key {
    width: 50px;
    min-width: 50px;
    flex-shrink: 0;
}

.quick-chat-select {
    flex: 1;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-chat-select:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.quick-chat-select:focus {
    outline: none;
    border-color: #4CAF50;
}

.quick-chat-select option {
    background: #2a2a2a;
    color: #fff;
}

.quick-chat-custom {
    flex: 1;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.2s;
}

.quick-chat-custom:focus {
    outline: none;
    border-color: #4CAF50;
    background: rgba(255, 255, 255, 0.15);
}

.quick-chat-custom::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Speech Bubbles */
.speech-bubble {
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1000;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transform: translateX(-50%);
    animation: speechBubbleAppear 0.2s ease-out;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(0, 0, 0, 0.85);
}

@keyframes speechBubbleAppear {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes speechBubbleFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Quick Chat Display */
#quickChatDisplay {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 100;
    pointer-events: none;
}

.quick-chat-box {
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px 8px 0 0;
    padding: 12px 12px 6px 12px;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.quick-chat-key {
    position: absolute;
    top: -13px;
    left: -13px;
    background: rgba(255, 255, 255, 1);
    color: #000;
    font-size: 11px;
    font-weight: bold;
    border-radius: 4px;
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
    max-width: 26px;
    max-height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.quick-chat-message {
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
}

/* ===== Cosmetics Shop Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: rgba(40, 40, 40, 0.98);
    border-radius: 20px;
    padding: 30px;
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.modal-header h2 {
    color: white;
    font-size: 28px;
    margin: 0;
}

.coin-balance-display {
    color: white;
    font-size: 20px;
    font-weight: bold;
    background: rgba(255, 215, 0, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid rgba(255, 215, 0, 0.4);
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

/* Cosmetics Container - Column Layout */
.cosmetics-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Header Row: Preview + Tabs */
.cosmetics-header-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-shrink: 0;
}

/* Character Preview Panel */
.character-preview-panel {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1A1A24;
    border-radius: 10px;
    border: 1px solid #3A3F4A;
    padding: 5px;
}

#characterPreviewCanvas {
    background: linear-gradient(135deg, #1e3a1e 0%, #2d4a2d 100%);
    border-radius: 8px;
    display: block;
}

.cosmetics-tabs {
    display: flex;
    gap: 8px;
    flex: 1;
}

.cosmetics-tab {
    flex: 1;
    padding: 12px 10px;
    background: #2A2D35;
    border: 1px solid #3A3F4A;
    border-radius: 10px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.cosmetics-tab:hover {
    background: #2F3340;
    border-color: #4A9EFF;
    color: white;
}

.cosmetics-tab.active {
    background: #4A9EFF;
    border: 1px solid #4A9EFF;
    color: white;
    font-weight: bold;
}

.cosmetics-content {
    position: relative;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding-right: 10px;
}

/* Custom scrollbar for cosmetics content */
.cosmetics-content::-webkit-scrollbar {
    width: 8px;
}

.cosmetics-content::-webkit-scrollbar-track {
    background: #1A1A24;
    border-radius: 4px;
}

.cosmetics-content::-webkit-scrollbar-thumb {
    background: #3A3F4A;
    border-radius: 4px;
}

.cosmetics-content::-webkit-scrollbar-thumb:hover {
    background: #4A9EFF;
}

.cosmetics-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
    gap: 10px;
    padding-bottom: 10px;
}

.cosmetics-grid.active {
    display: grid;
}

.cosmetic-item {
    background: #2A2D35;
    border: 1px solid #3A3F4A;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.cosmetic-item:hover {
    background: #2F3340;
    border-color: #4A9EFF;
    transform: translateY(-3px);
}

.cosmetic-item.locked {
    opacity: 0.6;
    cursor: default;
}

.cosmetic-item.locked:hover {
    transform: none;
}

.cosmetic-item.equipped {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.cosmetic-preview {
    width: 60px;
    height: 60px;
    margin: 0 auto 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.cosmetic-preview.color-preview {
    border: 2px solid #3A3F4A;
}

.cosmetic-preview.explosion-preview {
    background: #2A2D35;
    border-radius: 10px;
    overflow: hidden;
}

.explosion-preview-canvas {
    border-radius: 8px;
}

.cosmetic-name {
    color: white;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 4px;
}

.cosmetic-rarity {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: bold;
    margin-bottom: 8px;
}

.cosmetic-rarity.common {
    color: #9E9E9E;
}

.cosmetic-rarity.rare {
    color: #2196F3;
}

.cosmetic-rarity.epic {
    color: #9C27B0;
}

.cosmetic-rarity.legendary {
    color: #FF9800;
}

.cosmetic-price {
    color: #FFD700;
    font-size: 13px;
    font-weight: bold;
}

.cosmetic-status {
    font-size: 12px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 12px;
    margin-top: 8px;
    display: inline-block;
}

.cosmetic-status.owned {
    background: rgba(33, 150, 243, 0.3);
    color: #64B5F6;
}

.cosmetic-status.equipped-status {
    background: rgba(76, 175, 80, 0.3);
    color: #81C784;
}

.cosmetic-btn {
    margin-top: 6px;
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.cosmetic-btn.purchase-btn {
    background: #4A9EFF;
    color: white;
    border: 1px solid #4A9EFF;
}

.cosmetic-btn.purchase-btn:hover {
    transform: scale(1.05);
    background: #5AADFF;
    border-color: #5AADFF;
    box-shadow: 0 5px 15px rgba(74,158,255,0.4);
}

.cosmetic-btn.equip-btn {
    background: rgba(76, 175, 80, 0.3);
    color: #81C784;
    border: 2px solid #4CAF50;
}

.cosmetic-btn.equip-btn:hover {
    background: rgba(76, 175, 80, 0.5);
}

.cosmetic-btn.equipped-btn {
    background: rgba(76, 175, 80, 0.5);
    color: white;
    cursor: default;
}

.cosmetic-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Achievement-locked cosmetics */
.cosmetic-item.achievement-locked {
    border: 2px solid rgba(255, 193, 7, 0.3);
    background: rgba(255, 193, 7, 0.05);
}

.cosmetic-item.achievement-locked:hover {
    border-color: rgba(255, 193, 7, 0.5);
    background: rgba(255, 193, 7, 0.1);
}

.cosmetic-btn.achievement-btn {
    background: rgba(255, 193, 7, 0.2);
    color: #FFC107;
    border: 2px solid rgba(255, 193, 7, 0.5);
    font-size: 12px;
    cursor: help;
}

.cosmetic-btn.achievement-btn:hover {
    background: rgba(255, 193, 7, 0.3);
}

/* Icon preview in cosmetics shop */
.icon-preview-container {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Profile Level Display */
.profile-level-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    margin-bottom: 20px;
}

.profile-level-badge {
    background: #4A9EFF;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
}

.profile-xp-bar {
    flex: 1;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

.profile-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #4A9EFF, #7BB8FF);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.profile-xp-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    white-space: nowrap;
}

/* Stats Mode Tabs (1v1/2v2) */
.stats-mode-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.stats-mode-tab {
    flex: 1;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
}

.stats-mode-tab:hover {
    background: rgba(255, 255, 255, 0.1);
}

.stats-mode-tab.active {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
}

.stats-mode-content {
    display: none;
}

.stats-mode-content.active {
    display: block;
}

/* Profile Stats Section - Settings-matched color scheme */
.stats-section {
    background: rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 25px;
}

/* Hero ELO Display */
.hero-elo {
    text-align: center;
    margin-bottom: 25px;
    padding: 25px;
    background: rgba(0,0,0,0.6);
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
}

.elo-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.elo-label {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.elo-value {
    font-size: 54px;
    font-weight: bold;
    color: white;
}

.rank-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rank-label {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.elo-rank {
    font-size: 36px;
    font-weight: bold;
    color: white;
}

/* Win/Loss/Draw Bar */
.record-bar-container {
    margin-bottom: 25px;
}

.record-bar {
    display: flex;
    height: 50px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0,0,0,0.7);
    border: 2px solid rgba(255,255,255,0.1);
}

.record-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    min-width: 0;
}

.record-segment.wins {
    background: rgba(76, 175, 80, 0.8);
}

.record-segment.losses {
    background: rgba(244, 67, 54, 0.8);
}

.record-segment.draws {
    background: rgba(158, 158, 158, 0.8);
}

.segment-label {
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
}

/* Stats List */
.stats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: rgba(0,0,0,0.6);
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 10px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(0,0,0,0.4);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
}

.stat-list-label {
    color: rgba(255,255,255,0.7);
    font-size: 16px;
    font-weight: 500;
}

.stat-list-value {
    color: white;
    font-size: 20px;
    font-weight: bold;
}

/* ===== Profile Main Tabs (Stats/Achievements/Battle Log) ===== */
.profile-main-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.profile-main-tab {
    flex: 1;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.6);
}

.profile-main-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.profile-main-tab.active {
    background: rgba(74, 158, 255, 0.2);
    border-color: #4A9EFF;
    color: white;
}

.profile-tab-content {
    display: none;
}

.profile-tab-content.active {
    display: block;
}

/* ===== Stats Tab Layout ===== */
.stats-top-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.player-avatar-container {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
}

#profilePlayerCanvas {
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.4);
}

.player-avatar-label {
    margin-top: 10px;
    color: white;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-avatar-container .profile-level-display {
    margin-top: 12px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.player-avatar-container .profile-level-badge {
    background: #4A9EFF;
    color: white;
    font-weight: bold;
    font-size: 14px;
    padding: 4px 12px;
    border-radius: 15px;
}

.player-avatar-container .profile-xp-bar {
    flex: none;
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.player-avatar-container .profile-xp-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #4A9EFF, #00D4FF);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.player-avatar-container .profile-xp-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

.overall-stats-container {
    flex: 1;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
}

.overall-stats-container h4 {
    margin: 0 0 12px 0;
    color: #4A9EFF;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.overall-hero-elo {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(74, 158, 255, 0.15);
    border: 1px solid rgba(74, 158, 255, 0.3);
    border-radius: 8px;
}

.overall-hero-elo .elo-value {
    font-size: 36px;
}

.overall-hero-elo .elo-rank {
    font-size: 24px;
}

.overall-record-bar-container {
    margin-bottom: 12px;
}

.overall-record-bar-container .record-bar {
    height: 35px;
}

.overall-stats-list {
    display: flex;
    gap: 15px;
}

.stat-row-inline {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(74, 158, 255, 0.15);
    border-radius: 8px;
    border: 1px solid rgba(74, 158, 255, 0.3);
}

/* ===== Stats Bottom Row (1v1/2v2 Side by Side) ===== */
.stats-bottom-row {
    display: flex;
    gap: 20px;
}

.mode-stats-panel {
    flex: 1;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
}

.mode-stats-panel h4 {
    margin: 0 0 12px 0;
    color: #4A9EFF;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

/* Compact versions for side-by-side layout */
.hero-elo.compact {
    padding: 15px;
    margin-bottom: 15px;
    gap: 20px;
}

.hero-elo.compact .elo-value {
    font-size: 32px;
}

.hero-elo.compact .elo-rank {
    font-size: 20px;
}

.record-bar-container.compact {
    margin-bottom: 15px;
}

.record-bar-container.compact .record-bar {
    height: 35px;
}

.stats-list.compact {
    padding: 12px;
}

.stats-list.compact .stat-row {
    padding: 8px 12px;
}

.stats-list.compact .stat-list-label {
    font-size: 14px;
}

.stats-list.compact .stat-list-value {
    font-size: 16px;
}

/* ===== Responsive Design for Profile ===== */
@media (max-width: 700px) {
    .stats-top-row {
        flex-direction: column;
    }

    .player-avatar-container {
        flex: 0 0 auto;
        width: 100%;
    }

    #profilePlayerCanvas {
        width: 120px;
        height: 120px;
    }

    .stats-bottom-row {
        flex-direction: column;
    }

    .profile-main-tabs {
        flex-wrap: wrap;
    }

    .profile-main-tab {
        flex: 1 0 30%;
        font-size: 13px;
        padding: 10px 12px;
    }
}

/* ===== Minimap ===== */
#minimapCanvas {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 150px;
    height: 100px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    z-index: 100;
    pointer-events: none;
    display: none; /* Hidden by default, shown when entering lobby */
}

/* ===== Level Display & XP Bar ===== */
.level-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

.level-badge {
    background: #4A9EFF;
    color: white;
    font-weight: bold;
    font-size: 14px;
    padding: 4px 10px;
    border-radius: 15px;
    white-space: nowrap;
}

.xp-bar-container {
    width: 80px;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #8BC34A 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.xp-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
}

/* ===== XP Gained Notification ===== */
.xp-notification {
    position: fixed;
    top: 80px;
    right: 500px;
    transform: scale(0);
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 15px;
    text-align: center;
    z-index: 10001;
    transition: transform 0.3s ease;
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.5);
}

.xp-notification.show {
    transform: scale(1);
}

.xp-gained {
    font-size: 16px;
    font-weight: bold;
}

/* ===== Coins Gained Notification ===== */
.coins-notification {
    position: fixed;
    top: 80px;
    right: 160px;
    transform: scale(0);
    background: rgba(255, 193, 7, 0.9);
    color: #333;
    padding: 8px 16px;
    border-radius: 15px;
    text-align: center;
    z-index: 10001;
    transition: transform 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 193, 7, 0.5);
}

.coins-notification.show {
    transform: scale(1);
}

.coins-gained {
    font-size: 16px;
    font-weight: bold;
}

/* ===== Level Up Notification ===== */
.level-up-notification {
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid #3A3F4A;
    color: white;
    padding: 25px 40px;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 10002;
    transition: top 0.5s ease;
}

.level-up-notification.show {
    top: 80px;
}

.level-up-icon {
    font-size: 48px;
    animation: levelUpSpin 1s ease-in-out;
}

@keyframes levelUpSpin {
    0% { transform: rotate(0deg) scale(0.5); }
    50% { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

.level-up-title {
    font-size: 14px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.level-up-level {
    font-size: 32px;
    font-weight: bold;
}

.level-up-reward {
    font-size: 16px;
    color: #FFD700;
    font-weight: bold;
}

/* ===== Party Bar ===== */
.party-bar {
    position: fixed;
    top: 15px;
    left: 185px;  /* To the right of field info display */
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 10px 14px;
    color: white;
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 100;
}

.party-bar.active {
    display: flex;
}

.party-icon {
    font-size: 20px;
}

.party-text {
    font-size: 14px;
    font-weight: 500;
}

#partyMemberName {
    font-weight: bold;
}

.party-join-btn {
    background: rgba(76, 175, 80, 0.8);
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.party-join-btn:hover {
    background: rgba(76, 175, 80, 1);
}

.party-join-btn:disabled {
    background: rgba(255, 255, 255, 0.2);
    cursor: default;
}

.party-leave-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.party-leave-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== Party Invite Notification ===== */
.party-invite-notification {
    position: fixed;
    bottom: -150px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid #3A3F4A;
    border-radius: 15px;
    padding: 20px;
    color: white;
    z-index: 100000;
    transition: bottom 0.4s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 300px;
}

.party-invite-notification.show {
    bottom: 20px;
}

.party-invite-text {
    font-size: 14px;
    margin-bottom: 15px;
}

#partyInviterName {
    font-weight: bold;
    color: #FFD700;
}

.party-invite-buttons {
    display: flex;
    gap: 10px;
}

.party-invite-accept,
.party-invite-decline {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.party-invite-accept {
    background: #4CAF50;
    color: white;
}

.party-invite-accept:hover {
    background: #45a049;
}

.party-invite-decline {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.party-invite-decline:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== Friend Request Notification ===== */
.friend-request-notification {
    position: fixed;
    bottom: -150px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid #3A3F4A;
    border-radius: 15px;
    padding: 20px;
    color: white;
    z-index: 10003;
    transition: bottom 0.4s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 300px;
}

.friend-request-notification.show {
    bottom: 20px;
}

.friend-request-text {
    font-size: 14px;
    margin-bottom: 15px;
}

#friendRequesterName {
    font-weight: bold;
    color: #FFD700;
}

.friend-request-buttons {
    display: flex;
    gap: 10px;
}

.friend-request-accept,
.friend-request-decline {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.friend-request-accept {
    background: #4CAF50;
    color: white;
}

.friend-request-accept:hover {
    background: #45a049;
}

.friend-request-decline {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.friend-request-decline:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== Quest Completed Notification ===== */
.quest-completed-notification {
    position: fixed;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.5);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10001;
    transition: top 0.4s ease;
}

.quest-completed-notification.show {
    top: 20px;
}

.quest-completed-icon {
    font-size: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quest-completed-title {
    font-size: 12px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.quest-completed-name {
    font-size: 18px;
    font-weight: bold;
}

/* ===== Quest Modal Styles ===== */
.quests-modal-content {
    width: 550px;
    max-width: 95%;
}

.quests-body {
    display: flex;
    gap: 15px;
}

.quests-main {
    flex: 1;
}

.quest-timers-sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    min-width: 100px;
}

.quest-timer {
    text-align: center;
}

.timer-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    display: block;
    margin-bottom: 3px;
}

.timer-value {
    font-size: 16px;
    font-weight: bold;
    color: #4CAF50;
    font-family: monospace;
}

.quest-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.quest-tab {
    flex: 1;
    padding: 8px 12px;
    background: #2A2D35;
    border: 1px solid #3A3F4A;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.quest-tab:hover {
    background: #2F3340;
    border-color: #4A9EFF;
    color: white;
}

.quest-tab.active {
    background: #4A9EFF;
    border-color: #4A9EFF;
    color: white;
}

.quest-list {
    display: none;
    flex-direction: column;
    gap: 8px;
}

.quest-list.active {
    display: flex;
}

.quest-item {
    background: #2A2D35;
    border: 1px solid #3A3F4A;
    border-radius: 8px;
    padding: 10px 12px;
    transition: all 0.3s;
}

.quest-item:hover {
    background: #2F3340;
    border-color: #4A9EFF;
}

.quest-item.completed {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.quest-item.claimed {
    opacity: 0.6;
}

.quest-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.quest-name {
    font-size: 14px;
    font-weight: bold;
    color: white;
}

.quest-rewards {
    display: flex;
    gap: 10px;
    font-size: 12px;
}

.quest-coin-reward {
    color: #FFD700;
}

.quest-xp-reward {
    color: #4CAF50;
}

.quest-description {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.quest-progress-container {
    margin-bottom: 6px;
}

.quest-progress-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 3px;
}

.quest-progress-fill {
    height: 100%;
    background: #4A9EFF;
    border-radius: 5px;
    transition: width 0.3s ease;
}

.quest-item.completed .quest-progress-fill {
    background: linear-gradient(90deg, #4CAF50 0%, #8BC34A 100%);
}

.quest-progress-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    text-align: right;
}

.quest-claim-btn {
    width: 100%;
    padding: 8px;
    background: #4CAF50;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.quest-claim-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.quest-claim-btn:disabled {
    background: #3A3F4A;
    cursor: not-allowed;
    transform: none;
}

.quest-claimed-text {
    text-align: center;
    color: #4CAF50;
    font-weight: bold;
    padding: 12px;
}

/* ===== Friends Modal Styles ===== */
.friends-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.friends-tab {
    flex: 1;
    padding: 8px 12px;
    background: #2A2D35;
    border: 1px solid #3A3F4A;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.friends-tab:hover {
    background: #2F3340;
    border-color: #4A9EFF;
    color: white;
}

.friends-tab.active {
    background: #4A9EFF;
    border-color: #4A9EFF;
    color: white;
}

.badge {
    background: #f44336;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 5px;
}

.friends-list-container {
    display: none;
}

.friends-list-container.active {
    display: block;
}

.friends-list-container h4 {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin: 12px 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid #3A3F4A;
}

.friends-list-container h4:first-child {
    margin-top: 0;
}

.friends-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 400px;
    overflow-y: auto;
}

.friend-item {
    background: #2A2D35;
    border: 1px solid #3A3F4A;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.friend-item:hover {
    background: #2F3340;
    border-color: #4A9EFF;
}

.friend-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.friend-status.online {
    background: #4CAF50;
    box-shadow: 0 0 8px #4CAF50;
}

.friend-status.offline {
    background: #666;
}

.friend-info {
    flex: 1;
}

.friend-name {
    font-weight: bold;
    color: white;
    font-size: 15px;
}

.friend-status-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.friend-since {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.friend-actions {
    display: flex;
    gap: 8px;
}

.friend-action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.friend-action-btn.invite {
    background: #667eea;
    color: white;
}

.friend-action-btn.invite:hover {
    background: #764ba2;
}

.friend-action-btn.remove {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.friend-action-btn.remove:hover {
    background: rgba(244, 67, 54, 0.3);
}

.friend-action-btn.accept {
    background: #4CAF50;
    color: white;
}

.friend-action-btn.accept:hover {
    background: #45a049;
}

.friend-action-btn.decline {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.friend-action-btn.decline:hover {
    background: rgba(255, 255, 255, 0.2);
}

.friend-action-btn.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.friend-action-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

.friend-action-btn.add {
    background: #4A9EFF;
    color: white;
}

.friend-action-btn.add:hover {
    background: #357abd;
}

.friend-action-btn.pending {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    cursor: default;
}

.friend-action-btn.invited {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    cursor: default;
}

.friend-action-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Friend Search */
.friend-search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#friendSearchInput {
    flex: 1;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
}

#friendSearchInput:focus {
    outline: none;
    border-color: #4A9EFF;
    background: rgba(255, 255, 255, 0.15);
}

#friendSearchInput::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-btn {
    padding: 12px 25px;
    background: #4A9EFF;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.search-btn:hover {
    background: #357abd;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 16px;
}

/* ===== Updated Button Positions ===== */
#viewQuestsBtn {
    right: 260px;
    display: block;
    position: absolute;
}

.quest-badge {
    position: absolute;
    font-size: 12px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 4px;
    display: none;
    padding: 0 4px;
    box-sizing: border-box;
    color: white;
}

.quest-badge.pending {
    top: -8px;
    left: -8px;
    background: #e74c3c;
}

.quest-badge.completed {
    top: -8px;
    right: -8px;
    background: #27ae60;
}

.quest-badge.show {
    display: block;
}

#viewFriendsBtn {
    right: 320px;
    display: block;
    position: absolute;
}

.friend-request-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    background: #e74c3c;
    color: white;
    font-size: 12px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 4px;
    display: none;
    padding: 0 4px;
    box-sizing: border-box;
}

.friend-request-badge.show {
    display: block;
}

#viewCosmeticsBtn {
    right: 200px;
}

#viewProfileBtn {
    right: 140px;
}

#viewLeaderboardBtn {
    right: 80px;
}

/* Update stats display position to account for new buttons */
.stats-display {
    right: 390px;
}

/* ===== Guest Header Message ===== */
.guest-header-message {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(74, 158, 255, 0.15);
    border: 1px solid rgba(74, 158, 255, 0.3);
    border-radius: 8px;
}

.guest-header-text {
    color: #4A9EFF;
    font-size: 13px;
    font-weight: 500;
}

.guest-header-login-btn {
    background: #4A9EFF;
    color: white;
    border: none;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.guest-header-login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.4);
}
