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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f1419 0%, #1a2332 100%);
    color: #e8e9ea;
    height: 100vh;
    overflow: hidden;
}

#gameContainer {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

#headerPanel {
    background: rgba(40, 50, 60, 0.9);
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid #ffd700;
    flex-shrink: 0;
}

#logoSection {
    display: flex;
    align-items: center;
    gap: 15px;
}

#gameLogo {
    height: 35px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#headerPanel h1 {
    font-size: 18px;
    font-weight: bold;
    background: linear-gradient(45deg, #ffd700, #ffed4a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

#connectionStatus {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
}

#connectionStatus.connected {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid #22c55e;
}

#connectionStatus.disconnected {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid #ef4444;
}

#connectionStatus.connecting {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid #fbbf24;
}

#mainContent {
    display: flex;
    flex: 1;
    gap: 15px;
    padding: 10px;
    height: calc(100vh - 100px);
    overflow: hidden;
}

#gameArea {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameCanvas {
    border: 3px solid #ffd700;
    border-radius: 10px;
    background: #0a0e14;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

#gameOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

#gameOverlay.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}



#overlayTitle {
    font-size: 28px;
    margin-bottom: 15px;
    color: #ffd700;
}

#overlayMessage {
    font-size: 16px;
    margin-bottom: 25px;
    color: #c8c9ca;
    text-align: left;
}

.how-to-play {
    background: rgba(30, 40, 50, 0.8);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #555;
    margin-bottom: 20px;
}

.how-to-play h3 {
    color: #ffd700;
    margin-bottom: 15px;
    text-align: center;
}

.how-to-play ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.how-to-play li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.how-to-play p {
    text-align: center;
    font-weight: bold;
    color: #22c55e;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #555;
}

#overlayControls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

/* Profile Picture Upload Styles */
.player-profile-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    width: 100%;
}

.profile-picture-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.profile-picture-preview {
    width: 80px;
    height: 80px;
    border: 2px solid #555;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(40, 50, 60, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.profile-picture-preview:hover {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.profile-picture-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.upload-placeholder {
    text-align: center;
    font-size: 12px;
    color: #c8c9ca;
    padding: 5px;
}

.upload-btn {
    padding: 8px 16px;
    background: linear-gradient(45deg, #22c55e, #16a34a);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    background: linear-gradient(45deg, #16a34a, #15803d);
    transform: translateY(-1px);
}

.avatar-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 10px 0;
    max-width: 300px;
}

.avatar-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.avatar-option:hover {
    border-color: #ffd700;
    transform: scale(1.1);
}

.avatar-option.selected {
    border-color: #22c55e;
    border-width: 3px;
    transform: scale(1.1);
}

.avatar-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.room-url-display {
    margin-top: 15px;
    padding: 15px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid #22c55e;
    border-radius: 8px;
}

.room-url-display h5 {
    margin: 0 0 10px 0;
    color: #22c55e;
    font-size: 14px;
}

.url-container {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.url-container input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    background: rgba(20, 30, 40, 0.8);
    border: 1px solid #555;
    border-radius: 6px;
    color: #e8e9ea;
    font-size: 12px;
    font-family: monospace;
}

.copy-btn {
    padding: 8px 12px;
    background: linear-gradient(45deg, #22c55e, #16a34a);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: linear-gradient(45deg, #16a34a, #15803d);
    transform: translateY(-1px);
}

.copy-btn.copied {
    background: linear-gradient(45deg, #ffd700, #ffed4a);
    color: #000;
}

.url-hint {
    margin: 0;
    font-size: 11px;
    color: #16a34a;
    text-align: center;
}

.game-url-share {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(34, 197, 94, 0.95);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #22c55e;
    z-index: 1000;
    min-width: 280px;
    max-width: 320px;
}

.game-url-share h6 {
    margin: 0 0 8px 0;
    color: white;
    font-size: 12px;
}

.game-url-share .url-container {
    margin-bottom: 5px;
}

.game-url-share .url-container input {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.game-url-share .copy-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.game-url-share .copy-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.game-url-share .url-hint {
    color: rgba(255, 255, 255, 0.9);
    font-size: 10px;
}

.game-mode-section {
    margin-bottom: 15px;
}

.game-mode-section h4 {
    margin: 0 0 10px 0;
    color: #ffd700;
    font-size: 16px;
}

.mode-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.mode-option-btn {
    width: 100%;
    padding: 16px 20px;
    background: rgba(20, 30, 40, 0.8);
    color: #e8e9ea;
    border: 2px solid #555;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mode-option-btn:hover {
    background: rgba(30, 40, 50, 0.9);
    border-color: #777;
    transform: translateY(-1px);
}

.mode-option-btn.selected {
    background: linear-gradient(45deg, #ffd700, #ffed4a);
    color: #000;
    border-color: #ffd700;
}

.name-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 300px;
}

#playerFullNameInput {
    padding: 12px 20px;
    border: 2px solid #555;
    border-radius: 8px;
    background: rgba(20, 30, 40, 0.8);
    color: #e8e9ea;
    font-size: 16px;
    width: 100%;
    transition: all 0.3s ease;
}

#playerFullNameInput:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}



#joinGameBtn {
    padding: 12px 30px;
    background: linear-gradient(45deg, #ffd700, #ffed4a);
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

#joinGameBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

#joinGameBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.start-hint {
    margin-top: 15px;
    padding: 10px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid #22c55e;
    border-radius: 6px;
}

.start-hint small {
    color: #22c55e;
    font-weight: bold;
}

/* Room joining styles */
.room-join-section,
.room-create-section {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid #ffd700;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.room-join-section h4,
.room-create-section h4 {
    color: #ffd700;
    margin: 0 0 10px 0;
    font-size: 16px;
}

.room-join-section p {
    margin: 10px 0;
    color: #e8e9ea;
}

.room-hint {
    margin-top: 10px;
    padding: 8px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid #22c55e;
    border-radius: 6px;
    color: #22c55e;
    font-size: 12px;
}

.room-options {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.room-option-btn {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.room-option-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

#roomIdInput {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    background: rgba(20, 30, 40, 0.8);
    border: 2px solid #555;
    border-radius: 8px;
    color: #e8e9ea;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

#roomIdInput:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* Voice Chat Interface Styles */
#voiceChatSection {
    min-height: 180px;
    max-height: 300px;
    overflow-y: auto;
}

#teamTalk {
    min-height: 160px;
}

.voice-chat-disabled {
    text-align: center;
    padding: 15px;
    color: #c8c9ca;
    background: rgba(30, 40, 50, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.voice-chat-disabled p {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #888;
}

.voice-chat-buttons {
    display: flex;
    gap: 8px;
    flex-direction: column;
}

.voice-chat-btn {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.voice-chat-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.voice-chat-btn.leave-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.voice-chat-btn.leave-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.voice-chat-active {
    background: rgba(20, 30, 40, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 12px;
}

.voice-participants {
    margin-bottom: 15px;
}

.participant-header {
    font-size: 12px;
    color: #10b981;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.participants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
}

.voice-participant {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 6px;
    font-size: 11px;
    text-align: center;
}

.voice-participant.speaking {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.voice-participant.muted {
    opacity: 0.5;
    background: rgba(107, 114, 128, 0.1);
    border-color: rgba(107, 114, 128, 0.3);
}

.participant-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 14px;
}

.participant-name {
    color: #e8e9ea;
    font-size: 10px;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voice-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.voice-control-btn {
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 4px;
    color: #10b981;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.voice-control-btn:hover {
    background: rgba(16, 185, 129, 0.3);
    border-color: #10b981;
}

.voice-control-btn.active {
    background: #10b981;
    color: white;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #888;
}

#volumeSlider {
    width: 60px;
    height: 4px;
    background: rgba(16, 185, 129, 0.2);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #10b981;
    cursor: pointer;
}

/* Chat Request Modal */
.chat-request-content {
    max-width: 420px;
    padding: 25px;
    background: linear-gradient(135deg, rgba(20, 30, 40, 0.95), rgba(30, 40, 50, 0.95));
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.chat-request-content .modal-header h3 {
    color: #ffd700;
    font-size: 18px;
    margin-bottom: 15px;
    text-align: center;
}

.chat-request-content .modal-body p {
    color: #e8e9ea;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
    text-align: center;
}

.chat-request-content .modal-body p:last-of-type {
    margin-bottom: 20px;
    color: #c8c9ca;
    font-size: 13px;
}

.chat-request-buttons {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.accept-chat-btn,
.decline-chat-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.accept-chat-btn {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.accept-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
    background: linear-gradient(135deg, #16a34a, #15803d);
}

.decline-chat-btn {
    background: linear-gradient(135deg, #64748b, #475569);
    color: white;
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.3);
}

.decline-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(100, 116, 139, 0.4);
    background: linear-gradient(135deg, #475569, #334155);
}

/* Enhanced start screen styles */
.start-steps {
    font-size: 16px;
    line-height: 1.8;
    margin: 20px 0;
}

.start-steps li {
    margin: 10px 0;
    padding: 8px;
    background: rgba(255, 215, 0, 0.1);
    border-left: 4px solid #ffd700;
    border-radius: 4px;
}

.multiplayer-info {
    background: rgba(34, 197, 94, 0.1);
    border: 2px solid #22c55e;
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
}

.multiplayer-info h4 {
    color: #22c55e;
    margin: 0 0 10px 0;
    font-size: 18px;
}

.multiplayer-info p {
    color: #c8c9ca;
    margin: 0;
    font-size: 14px;
}

.start-game-btn {
    width: 100%;
    padding: 20px;
    margin: 20px 0 10px 0;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 3px solid #ffd700;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.start-game-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.6);
}

.start-hint {
    margin-top: 15px;
    padding: 12px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid #22c55e;
    border-radius: 6px;
    color: #22c55e;
    font-weight: normal;
    font-size: 14px;
    text-align: center;
    font-style: italic;
}

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

/* Panel Button Styles */
.panel-button {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.panel-button:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid #ffd700;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-header {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a1a2e;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #1a1a2e;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(26, 26, 46, 0.1);
}

.modal-body {
    padding: 0;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

/* Leaderboard Tabs */
.leaderboard-tabs {
    display: flex;
    background: rgba(30, 40, 50, 0.8);
    border-bottom: 1px solid #555;
}

.tab-btn {
    flex: 1;
    padding: 15px 10px;
    background: none;
    border: none;
    color: #c8c9ca;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
}

.tab-btn.active {
    color: #ffd700;
    border-bottom-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

/* Leaderboard Content */
#leaderboardContent {
    padding: 20px;
}

.loading {
    text-align: center;
    color: #c8c9ca;
    font-size: 16px;
    padding: 40px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(30, 40, 50, 0.8);
    border-radius: 10px;
    overflow: hidden;
}

.leaderboard-table th {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a1a2e;
    padding: 15px 10px;
    text-align: left;
    font-weight: bold;
    font-size: 14px;
}

.leaderboard-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #555;
    color: #c8c9ca;
    font-size: 14px;
}

.leaderboard-table tr:hover {
    background: rgba(255, 215, 0, 0.1);
}

.leaderboard-table .rank {
    text-align: center;
    font-weight: bold;
    color: #ffd700;
    width: 50px;
}

.leaderboard-table .name {
    font-weight: bold;
    color: #22c55e;
}

.leaderboard-table .player {
    font-weight: bold;
    color: #22c55e;
}

.leaderboard-table .stat {
    text-align: right;
    font-weight: bold;
}

/* Player Info in Leaderboard */
.player-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #555;
}

.profile-pic-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(40, 50, 60, 0.8);
    border: 2px solid #555;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #888;
}

.player-names {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.full-name {
    font-weight: bold;
    color: #e8e9ea;
    font-size: 14px;
}

.username {
    font-size: 12px;
    color: #888;
    font-style: italic;
}

.leaderboard-table .crown {
    color: #ffd700;
    font-size: 18px;
}

.no-data {
    text-align: center;
    color: #c8c9ca;
    font-style: italic;
    padding: 40px;
}

#sidePanel {
    width: 250px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    overflow-y: auto;
    padding-bottom: 20px;
}

.panel-section {
    background: rgba(40, 50, 60, 0.8);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #555;
    backdrop-filter: blur(10px);
}

#scoreBoard,
#inventory,
#powerupLegend,
#controls,
#teamTalk {
    background: rgba(40, 50, 60, 0.8);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #555;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    margin-bottom: 8px;
}

#scoreBoard h3,
#inventory h3,
#powerupLegend h3,
#controls h3,
#teamTalk h3 {
    color: #ffd700;
    margin-bottom: 8px;
    font-size: 14px;
    border-bottom: 2px solid #ffd700;
    padding-bottom: 5px;
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #333;
}

.player-item:last-child {
    border-bottom: none;
}

.player-name {
    font-weight: bold;
}

.player-score {
    color: #22c55e;
}

.player-crown {
    color: #ffd700;
    margin-left: 5px;
}

.inventory-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #333;
}

.inventory-item:last-child {
    border-bottom: none;
}

.inventory-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
}

.inventory-key {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 14px;
}

.powerup-icon {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

.powerup-icon.speed {
    background: #0096ff;
}

.powerup-icon.magnet {
    background: #ffc800;
}

.powerup-icon.chaos {
    background: #ff0096;
}

.powerup-icon.clone {
    background: #b400ff;
}

.control-info {
    font-size: 14px;
    line-height: 1.6;
    color: #c8c9ca;
}

/* Mobile/Desktop specific display */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
    
    /* Enhanced mobile canvas experience */
    canvas {
        touch-action: none; /* Prevent default touch behaviors like scrolling */
        user-select: none; /* Prevent text selection */
        cursor: pointer;
    }
    
    /* Show mobile controls */
    #mobileControls {
        display: block !important;
    }
}

/* AdSense Banner Styles */
.ad-banner-container {
    margin: 20px 0;
    padding: 15px;
    background: rgba(26, 26, 46, 0.8);
    border: 1px solid #444;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}



/* Ensure ad containers don't break layout */
.ad-banner-container ins,
.bottom-ad-banner ins {
    width: 100%;
    max-width: 100%;
}

/* Responsive ad banner adjustments */
@media (max-width: 768px) {
    .ad-banner-container {
        margin: 10px 0;
        padding: 10px;
    }
    

}

@media (max-width: 480px) {
    .ad-banner-container {
        margin: 8px 0;
        padding: 8px;
    }
    

}

.control-info div {
    margin-bottom: 5px;
}

#mobileControls {
    display: none;
    margin-top: 15px;
}

.control-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.control-btn,
.power-btn {
    width: 50px;
    height: 50px;
    border: 2px solid #555;
    background: rgba(40, 50, 60, 0.8);
    color: #e8e9ea;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.control-btn:hover,
.power-btn:hover {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.control-btn:active,
.power-btn:active {
    transform: scale(0.95);
}

.power-btn {
    background: linear-gradient(45deg, #ffd700, #ffed4a);
    color: #000;
    border-color: #ffd700;
}

.power-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#gameStatus {
    background: rgba(40, 50, 60, 0.9);
    padding: 5px 15px;
    border-top: 1px solid #555;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

#gameInfo {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 14px;
    color: #c8c9ca;
}

/* Mobile responsive design */
@media (max-width: 1024px) {
    #mainContent {
        flex-direction: column;
        gap: 15px;
    }
    
    #sidePanel {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    #scoreBoard,
    #inventory,
    #powerupLegend,
    #controls {
        flex: 1;
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    #headerPanel {
        padding: 10px 15px;
    }
    
    #logoSection {
        gap: 10px;
    }
    
    #gameLogo {
        height: 40px;
    }
    
    #headerPanel h1 {
        font-size: 18px;
    }
    
    #mainContent {
        padding: 15px;
    }
    
    #gameCanvas {
        max-width: 100%;
        height: auto;
    }
    
    #sidePanel {
        flex-direction: column;
    }
    
    #mobileControls {
        display: block;
    }
    
    .mobile-only {
        display: block !important;
    }
    
    #overlayContent {
        padding: 30px 20px;
        margin: 0 20px;
    }
    
    #playerNameInput {
        width: 100%;
        max-width: 250px;
    }
    
    #gameInfo {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .prominent-exit-btn {
        padding: 8px 16px;
        font-size: 12px;
        margin-top: 10px;
    }
    
    #headerPanel {
        flex-direction: column;
        gap: 10px;
    }
    
    #gameLogo {
        height: 35px;
    }
    
    #gameInfo span {
        font-size: 12px;
    }
    
    .control-btn,
    .power-btn {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
}

/* Animations */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

.crown-glow {
    animation: pulse 2s infinite;
}

.fade-in {
    opacity: 0;
    animation: fadeIn 0.5s ease-in forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.slide-up {
    transform: translateY(20px);
    opacity: 0;
    animation: slideUp 0.5s ease-out forwards;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}





/* Enhanced scrollbar styling for better visibility */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(40, 50, 60, 0.8);
    border-radius: 6px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ffd700, #ffed4a);
    border-radius: 6px;
    border: 1px solid rgba(255, 215, 0, 0.8);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ffed4a, #ffd700);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
}

/* Add scroll indicator for overlay content */
#overlayContent {
    background: rgba(40, 50, 60, 0.95);
    padding: 40px;
    border-radius: 15px;
    border: 2px solid #ffd700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    color: #e8e9ea;
    text-align: center;
    width: 90%;
    min-height: 300px;
    /* Add scroll indicator styles */
    position: relative;
}

/* Alternative approach: scroll indicator as a floating hint */
#overlayContent::after {
    content: "↓ More options below ↓";
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 215, 0, 0.95);
    color: #000;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 10px;
    text-align: center;
    display: none;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    animation: gentle-pulse 2s infinite;
}

#overlayContent.has-scroll::after {
    display: block;
}

@keyframes gentle-pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}


/* Prominent Exit Button Styles */
.prominent-exit-btn {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    margin-top: 15px;
}

.prominent-exit-btn:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
}

.prominent-exit-btn:active {
    transform: translateY(0);
}

.prominent-exit-btn.hidden {
    display: none;
}



/* Player score pulsing animation for current player */
.player-item.current-player .player-score {
    animation: scorePulse 2s ease-in-out infinite;
}

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

/* Back button styles */
.back-btn {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    text-align: center;
}

.back-btn:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(75, 85, 99, 0.3);
}

.back-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(75, 85, 99, 0.2);
}

.room-input-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
