:root {
    --primary: #2563eb;
    --primary-glow: rgba(37, 99, 235, 0.2);
    --secondary: #16a34a;
    --danger: #dc2626;
    --dark: #ffffff;
    --darker: #ffffff;
    --glass: rgba(255, 255, 255, 0.85);
    --glass-heavy: rgba(255, 255, 255, 0.98);
    --border: rgba(0, 0, 0, 0.08);
    --text: #111b21;
    --text-dim: #54656f;
    --font-pixel: 'Press Start 2P', system-ui, sans-serif;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    --radius: 16px;
}

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

body {
    font-family: var(--font-pixel);
    background-color: var(--darker);
    color: var(--text);
    overflow: hidden;
    font-size: 11px;
    height: 100vh;
}

/* --- ADVANCED WELCOME SCREEN --- */
.welcome-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #f6f7f9 0%, #e2e6ea 100%);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s, transform 1s;
    /* Animated Background Pattern */
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    background-size: 200% 200%;
    animation: bgGradient 15s ease infinite;
}

@keyframes bgGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.welcome-overlay.hide {
    opacity: 0;
    transform: scale(1.1) rotate(0.5deg);
    pointer-events: none;
}

.welcome-container {
    display: flex;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 40px;
    max-width: 1000px;
    width: 95%;
    min-height: 650px;
    /* Increased min-height */
    height: auto;
    /* Allow growth */
    max-height: 90vh;
    /* Prevent overflowing screen */
    overflow: hidden;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.15),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    position: relative;
    overflow-y: auto;
    /* Scroll if still needed */
}

/* Hide scrollbar for cleaner look */
.welcome-container::-webkit-scrollbar {
    width: 6px;
}

.welcome-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

/* Background pixel decor */
.pixel-art-decor {
    position: absolute;
    width: 150px;
    height: 150px;
    opacity: 0.15;
    z-index: 0;
}

.pixel-art-decor.top-left {
    top: -20px;
    left: -20px;
    border-radius: 50%;
    background: var(--primary);
    filter: blur(60px);
}

.pixel-art-decor.bottom-right {
    bottom: -20px;
    right: -20px;
    border-radius: 50%;
    background: var(--secondary);
    filter: blur(60px);
}

.welcome-hero {
    flex: 1.2;
    position: relative;
    background: #f6f6f6;
}

.hero-image-frame {
    height: 100%;
    width: 100%;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

.overlay-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 70%, var(--dark) 100%),
        linear-gradient(0deg, var(--dark) 10%, transparent 40%);
}

.welcome-content-card {
    flex: 1;
    padding: 30px 40px;
    /* Reduced vertical padding */
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 1;
    background: #f6f6f6;
    /* Ensure it stays solid under the hero image overflow */
}

.branding {
    margin-bottom: 1rem;
    /* Reduced from 2rem */
}

.glitch-text {
    font-size: 30px;
    /* Reduced to fit */
    letter-spacing: 1px;
    /* Reduced spacing */
    color: var(--text);
    position: relative;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 800;
}

.glitch-text span.highlight {
    color: var(--primary);
    text-shadow: 2px 2px 0px rgba(37, 99, 235, 0.2);
}

.author-tag {
    font-size: 10px;
    /* Bigger tag */
    color: var(--text-dim);
    letter-spacing: 2px;
    font-weight: 600;
}

.pathum {
    color: var(--text);
    font-weight: bold;
    border-bottom: 1px solid var(--primary);
}

.description {
    font-size: 13px;
    line-height: 1.5;
    background: linear-gradient(90deg, #4b5563 0%, #171717 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    /* Compacted from 2.5rem */
    max-width: 380px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    /* Compacted from 1.5rem */
}

/* --- MODERN INPUT FIELDS --- */
.input-wrapper {
    position: relative;
    background: #f0f2f5;
    border: 2px solid transparent;
    border-radius: 16px;
    display: flex;
    align-items: center;
    /* More compact padding */
    padding: 0 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 2px 2px 6px rgba(0, 0, 0, 0.03);
    height: 50px;
    /* Fixed smaller height */
}

.input-wrapper:focus-within {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.3),
        inset 0 0 0 1px var(--primary);
    transform: translateY(-2px);
}

.input-wrapper i {
    font-size: 18px;
    color: var(--text-dim);
    margin-right: 15px;
    transition: color 0.3s;
}

.input-wrapper:focus-within i {
    color: var(--primary);
}

.toggle-password {
    cursor: pointer;
    margin-right: 0 !important;
    margin-left: 10px;
    z-index: 10;
}

.toggle-password:hover {
    opacity: 0.7;
}

.input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    padding: 0;
    /* Remove padding as wrapper has height */
    height: 100%;
    font-family: inherit;
    font-size: 11px;
    /* Slightly smaller text inside box */
    outline: none;
    width: 100%;
    font-weight: 600;
}

.input-wrapper input::placeholder {
    color: #9ca3af;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* --- MODERN GRADIENT BUTTON --- */
.launch-button {
    width: 100%;
    padding: 18px;
    margin-top: 15px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    background-size: 200% auto;
    color: white;
    font-family: inherit;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4);
    position: relative;
    overflow: hidden;
}

.launch-button:hover {
    background-position: right center;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 30px -5px rgba(124, 58, 237, 0.5);
}

.launch-button:active {
    transform: translateY(0) scale(0.98);
}

/* Shine effect */
.launch-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: btnShine 3s infinite;
}

@keyframes btnShine {
    0% {
        left: -100%;
    }

    20% {
        left: 100%;
    }

    100% {
        left: 100%;
    }
}

.community-stats {
    margin-top: 1.5rem;
    /* Compacted from 3.5rem */
    display: flex;
    gap: 25px;
}

.stat {
    font-size: 8px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-icon {
    color: var(--secondary);
    font-size: 7px;
    animation: pulseFade 1.5s infinite;
}

@keyframes pulseFade {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(1.3);
    }
}

/* --- APP LAYOUT --- */
#app {
    display: flex;
    width: 100vw;
    height: 100vh;
    position: relative;
    background: #ffffff;
}

#planet-background {
    position: absolute;
    inset: 0;
    background: #ffffff;
    z-index: 0;
}

#canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

#pixel-canvas {
    position: absolute;
    image-rendering: pixelated;
    cursor: crosshair;
}

/* --- CREATIVE PANELS --- */
.creative-panel {
    background: var(--glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: 0.3s;
}

.creative-panel:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.15);
}

.panel-header {
    font-size: 8px;
    color: var(--primary);
    margin-bottom: 12px;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
}

/* Info Group Top Left */
.info-group {
    position: absolute;
    top: 25px;
    left: 25px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    z-index: 100;
}

.status-panel {
    min-width: 180px;
}

.indicator-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    margin-bottom: 10px;
}

.status-badge {
    font-weight: 600;
    font-size: 9px;
    letter-spacing: 0.5px;
}

.status-badge.ready {
    color: var(--secondary);
}

.status-badge.wait {
    color: var(--danger);
}

.progress-container {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    width: var(--progress, 0%);
    height: 100%;
    background: var(--primary);
    transition: width 0.1s linear;
}

.shortcut-list {
    display: grid;
    gap: 8px;
}

.shortcut {
    font-size: 8px;
    color: var(--text-dim);
}

.shortcut span {
    color: var(--text);
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 5px;
    border-radius: 4px;
    margin-right: 8px;
}

.creator-footer {
    margin-top: 15px;
    text-align: center;
    font-size: 7px;
    color: var(--text-dim);
    border-top: 1px solid var(--border);
    padding-top: 10px;
    letter-spacing: 1px;
}

/* View Controls (Top Right) */
.floating-controls {
    position: absolute;
    display: flex;
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    z-index: 100;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

/* View Controls (Repositioned below profile) */
.view-controls {
    top: 90px;
    right: 25px;
    flex-direction: column;
    padding: 8px;
    width: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
}

/* Standalone Profile Button */
.top-right-profile {
    position: absolute;
    top: 25px;
    right: 25px;
    z-index: 200;
}

.user-profile-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    background: #fff;
}

.user-profile-button:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
}

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

/* Tools Controls (Left) */
.tools-controls {
    top: 25px;
    left: 25px;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 8px;
}

/* Color Controls */
.color-controls {
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 15px;
    border-radius: 12px;
    background: var(--glass-heavy);
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.color-palette {
    display: flex;
    gap: 6px;
}

.color-button {
    width: 28px;
    height: 28px;
    cursor: pointer;
    border-radius: 4px;
    /* Square/Box design */
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
}

.color-button:hover {
    transform: translateY(-4px) scale(1.1);
    border-color: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.color-button.selected {
    border-color: #fff;
    transform: translateY(-4px) scale(1.15);
    box-shadow: 0 0 15px var(--primary-glow), 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 11;
}

.picker-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border: 1px dashed var(--text-dim);
    position: relative;
    cursor: pointer;
    transition: 0.2s;
}

.picker-container:hover {
    background: rgba(255, 255, 255, 0.2);
    border-style: solid;
    border-color: var(--primary);
}

.picker-container input[type="color"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.picker-container i {
    font-size: 14px;
    color: var(--text-dim);
    pointer-events: none;
}

/* Helper for time visibility */
#next-pixel-time {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
    padding: 2px 6px;
    border-radius: 6px;
}

.status-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.05);
}

/* Stats Group (Bottom Right - Modernized) */
.stats-group {
    position: absolute;
    bottom: 25px;
    right: 25px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
    z-index: 100;
}
.stats-panel {
    min-width: 170px;
    background: var(--glass-heavy);
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.online-stat {
    font-weight: 700;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
 

.sync-stat {
    font-size: 8px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sync-stat button {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 9px;
}

.online-stat #online-count {
    font-size: 28px;
    color: #10b981;
    font-weight: 900;
    line-height: 1;
}

.online-stat i {
    color: #10b981;
    font-size: 14px;
}

.online-stat i {
    color: #10b981;
    margin-right: 8px;
}
.coord-stat {
    color: #94a3b8;
    font-size: 8px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.02);
    padding: 4px 10px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid rgba(0,0,0,0.02);
}

.coord-stat span {
    color: var(--primary);
    font-weight: 800;
}

.mini-map-wrapper {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #f6f6f6;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

#mini-map-canvas {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

#mini-map-viewport {
    position: absolute;
    border: 2px solid var(--primary);
    background: rgba(37, 99, 235, 0.1);
    pointer-events: none;
}

/* --- CHAT --- */
.chat-container {
    position: fixed;
    left: 25px;
    bottom: 25px;
    z-index: 1000;
}

.chat-toggle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow);
    position: relative;
    font-size: 18px;
}

.unread-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: #fff;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 8px;
}

.chat-panel {
    position: absolute;
    bottom: 75px;
    left: 0;
    width: 320px;
    height: 480px;
    background: var(--glass-heavy);
    backdrop-filter: blur(25px);
    border: 1px solid var(--border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-panel.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.chat-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

#language-select {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 4px;
    font-family: inherit;
    font-size: 9px;
}

#minimize-chat {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 10px;
    line-height: 1.5;
    color: var(--text);
}

.chat-message.sent {
    align-self: flex-end;
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 2px;
}

.chat-message.received {
    align-self: flex-start;
    background: rgba(0, 0, 0, 0.05);
    border-bottom-left-radius: 2px;
}

.chat-message.system {
    align-self: center;
    font-size: 8px;
    opacity: 0.5;
    color: var(--text-dim);
}

.chat-input-row {
    padding: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(0, 0, 0, 0.02);
}

#chat-input {
    flex: 1;
    background: #f6f6f6;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 10px;
    outline: none;
}

#send-message {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
}

/* Emoji Panel */
.emoji-panel {
    position: absolute;
    bottom: 70px;
    left: 15px;
    width: 280px;
    max-height: 250px;
    background: #f6f6f6;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 15px;
    display: none;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    overflow-y: auto;
    z-index: 1001;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.emoji-panel.show {
    display: grid;
}

.emoji-item {
    cursor: pointer;
    font-size: 20px;
    text-align: center;
}

/* MODERN NOTIFICATION SYSTEM */
.notification-container {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

.pixel-notification {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(246, 246, 246, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-left: 4px solid var(--primary);
    padding: 16px 20px;
    border-radius: 16px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.6;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04);
    animation: notificationSlideIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    transition: all 0.3s ease;
}

.pixel-notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {

    0%,
    100% {
        opacity: 1;
        transform: scaleY(1);
    }

    50% {
        opacity: 0.6;
        transform: scaleY(0.8);
    }
}

.pixel-notification:hover {
    transform: translateX(-5px) scale(1.02);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.12),
        0 5px 15px rgba(37, 99, 235, 0.1);
    border-left-width: 6px;
}

/* Join Notification Style */
.pixel-notification.join-notification {
    border-left-color: var(--secondary);
}

.join-notification::before {
    background: linear-gradient(180deg, #16a34a 0%, #10b981 100%);
}

/* Leave Notification Style */
.pixel-notification.leave-notification {
    border-left-color: #f59e0b;
}

.leave-notification::before {
    background: linear-gradient(180deg, #f59e0b 0%, #ef4444 100%);
}

/* Notification Icon (Added via JS or HTML) */
.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.join-notification .notification-icon {
    background: linear-gradient(135deg, var(--secondary) 0%, #10b981 100%);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.leave-notification .notification-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.notification-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notification-title {
    font-weight: 800;
    font-size: 11px;
    color: var(--text);
    letter-spacing: 0.5px;
}

.notification-message {
    font-size: 9px;
    color: var(--text-dim);
    font-weight: 500;
}

/* Modern Slide-in Animation with Bounce */
@keyframes notificationSlideIn {
    0% {
        transform: translateX(120%) scale(0.8);
        opacity: 0;
    }

    60% {
        transform: translateX(-10px) scale(1.05);
        opacity: 1;
    }

    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* Fade Out Animation */
@keyframes fadeOutChill {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateX(50px) scale(0.9);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .notification-container {
        top: 15px;
        right: 15px;
        left: 15px;
        max-width: none;
    }

    .pixel-notification {
        min-width: auto;
        padding: 14px 16px;
        font-size: 9px;
    }

    .notification-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: var(--glass-heavy);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    z-index: 10001;
    display: none;
    min-width: 180px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.menu-item {
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 9px;
    color: var(--text);
}

.menu-item:hover {
    background: var(--primary);
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        font-size: 10px;
    }

    /* Mobile Welcome Screen Enhancements */
    .welcome-container {
        flex-direction: column;
        height: auto;
        min-height: 90vh;
        /* maximize height */
        width: 95%;
        /* maximize width */
        border-radius: 24px;
        margin: 10px auto;
        overflow-y: auto;
        /* allow scrolling if content overflows */
    }

    .welcome-hero {
        flex: 0 0 200px;
        /* fixed height for hero image */
        height: 200px;
        min-height: 200px;
        width: 100%;
    }

    .welcome-content-card {
        padding: 30px 20px;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        /* align to top */
        gap: 20px;
    }

    .branding {
        margin-bottom: 20px;
        text-align: center;
    }

    .glitch-text {
        font-size: 22px;
        /* Much smaller for mobile safety */
        letter-spacing: 0.5px;
    }

    .description {
        font-size: 12px;
        /* larger text */
        margin-bottom: 30px;
        text-align: center;
        max-width: 100%;
        line-height: 1.6;
    }

    .login-form {
        width: 100%;
        gap: 20px;
    }

    .input-wrapper {
        padding: 5px 20px;
        /* larger touch area */
        height: 60px;
    }

    .input-wrapper i {
        font-size: 18px;
    }

    #username-input {
        font-size: 16px;
        /* prevent iOS zoom */
        padding: 15px 0;
    }

    /* Mobile Launch Button */
    .launch-button {
        font-size: 18px;
        /* slightly smaller font to fit width */
        padding: 25px 20px;
        /* larger touch target */
        margin-top: 10px;
        white-space: normal;
        /* allow text wrap if really needed, but usually nowrap is better */
    }

    .launch-button .right::after {
        padding: 40px 20px;
        /* match parent padding */
    }

    .community-stats {
        margin-top: auto;
        /* Push to bottom */
        padding-top: 30px;
        flex-direction: row;
        justify-content: center;
        gap: 20px;
        flex-wrap: wrap;
    }

    /* Hide non-essential UI on mobile welcome to reduce clutter */
    .info-group {
        display: none;
        /* Hide top-left info panel on mobile */
    }

    .status-panel,
    .help-panel {
        display: none;
    }

    .floating-controls {
        padding: 3px;
        gap: 3px;
        border-radius: 10px;
    }

    button,
    .tool-button {
        width: 32px;
        height: 32px;
        font-size: 14px;
        border-radius: 8px;
    }

    .view-controls {
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
    }

    .tools-controls {
        top: 10px;
        left: 10px;
        flex-direction: row;
    }

    .color-controls {
        bottom: 10px;
        padding: 6px 12px;
        max-width: 95%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .color-palette {
        gap: 6px;
    }

    .color-button {
        width: 24px;
        height: 24px;
        min-width: 24px;
        border-radius: 12px;
    }

    .picker-container {
        width: 30px;
        height: 30px;
    }

    #custom-color {
        width: 22px;
        height: 22px;
    }

    .chat-container {
        left: 10px;
        bottom: 10px;
    }

    .chat-toggle {
        width: 40px;
        height: 40px;
        font-size: 18px;
        border-radius: 10px;
    }

    .chat-panel {
        width: calc(100vw - 20px);
        max-width: 300px;
        height: 50vh;
        max-height: 350px;
        bottom: 55px;
    }

    .mini-map-wrapper {
        display: none;
    }

    .stats-group {
        bottom: 10px;
        right: 10px;
    }
.stats-panel {
    min-width: 170px;
    background: var(--glass-heavy);
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .online-stat,
.coord-stat {
    color: #94a3b8;
    font-size: 8px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.02);
    padding: 4px 10px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid rgba(0,0,0,0.02);
}

.coord-stat span {
    color: var(--primary);
    font-weight: 800;
}

    /* Mobile-specific touch improvements */
    .creative-panel {
        padding: 10px;
    }
}

/* --- SOCIAL CONNECT --- */
.social-connect {
    margin-top: 5px;
    /* Moved up closer */
    margin-bottom: 5px;
    display: flex;
    gap: 20px;
    align-items: center;
}

.social-icon {
    width: 52px;
    /* Bigger icons */
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Softer border */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    color: var(--text-dim);
    font-size: 24px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.social-icon i {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.social-icon:hover {
    transform: translateY(-6px) scale(1.05);
    color: #fff;
    border-color: transparent;
}

.social-icon:hover i {
    transform: scale(1.2);
}

.social-icon.facebook:hover {
    background: linear-gradient(135deg, #1877F2, #165ec2);
    box-shadow: 0 10px 25px rgba(24, 119, 242, 0.4);
}

.social-icon.linkedin:hover {
    background: linear-gradient(135deg, #0A66C2, #004182);
    box-shadow: 0 10px 25px rgba(10, 102, 194, 0.4);
}

.social-icon.whatsapp:hover {
    background: linear-gradient(135deg, #25D366, #128C7E);
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
}

.social-icon.email:hover {
    background: linear-gradient(135deg, #EA4335, #c5221f);
    box-shadow: 0 10px 25px rgba(234, 67, 53, 0.4);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .social-connect {
        display: flex;
        justify-content: center;
        width: 100%;
        margin-top: 2rem;
        gap: 24px;
    }

    .social-icon {
        width: 54px;
        height: 54px;
        font-size: 24px;
    }
}

/* --- AUTH STYLES --- */
.auth-container {
    width: 100%;
    margin-top: 10px;
}

.auth-tabs {
    display: flex;
    background: #e5e7eb;
    padding: 4px;
    border-radius: 12px;
    border: none;
    margin-bottom: 25px;
    position: relative;
    user-select: none;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 11px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.auth-tab.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: scale(1.02);
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.3s ease;
}

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

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--text-dim);
    font-size: 8px;
    opacity: 0.6;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.divider span {
    padding: 0 10px;
}

.google-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 16px;
    background: #fff;
    color: #3c4043;
    text-decoration: none;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    font-size: 11px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 700;
    letter-spacing: 0.5px;
    overflow: hidden;
}

.google-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(0, 0, 0, 0.03), transparent);
    transform: translateX(-100%);
    transition: 0.5s;
}

.google-btn:hover {
    border-color: #d1d5db;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.1);
}

.google-btn:hover::before {
    transform: translateX(100%);
}

.google-btn i {
    color: #DB4437;
    /* Google Red */
    font-size: 18px;
    filter: drop-shadow(0 2px 3px rgba(219, 68, 55, 0.2));
}

.error-msg {
    color: var(--danger);
    font-size: 9px;
    margin-top: 10px;
    text-align: center;
    min-height: 14px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

.name-edit-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.username-edit-icon {
    background: none;
    border: none;
    color: var(--text-dim) !important;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
    padding: 5px;
    display: none;
}

.username-edit-icon:hover {
    color: var(--primary) !important;
    transform: scale(1.1);
}

.status-dot.online {
    background: #10b981 !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.status-dot.offline {
    background: #94a3b8 !important;
}