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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #000000;
    color: #e2e8f0;
}

/* Landing */
.landing {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #0f1419 0%, #000000 100%);
    z-index: 1000;
    transition: all 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.landing.fade-out {
    opacity: 0;
    transform: scale(0.9);
}

.hero {
    text-align: center;
    color: white;
    z-index: 2;
    position: relative;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    margin-bottom: 2.5rem;
    opacity: 0.8;
    font-weight: 400;
    color: #94a3b8;
}

.start-btn {
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    color: #3b82f6;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
}

.start-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

/* Floating Lights */
.floating-lights {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.floating-lights::before,
.floating-lights::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, rgba(59, 130, 246, 0.1) 40%, transparent 70%);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

.floating-lights::before {
    top: 5%;
    left: -10%;
    animation-delay: 0s;
}

.floating-lights::after {
    top: 40%;
    right: -15%;
    animation-delay: 4s;
    width: 600px;
    height: 600px;
}

.extra-light {
    position: absolute;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 60%);
    border-radius: 50%;
    top: 70%;
    left: 20%;
    animation: float 6s ease-in-out infinite;
    animation-delay: 2s;
}

.extra-light-2 {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.18) 0%, transparent 65%);
    border-radius: 50%;
    top: 15%;
    right: 30%;
    animation: float 10s ease-in-out infinite;
    animation-delay: 5s;
}

/* Main App */
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    background: #000000;
    transition: all 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.app.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Top Bar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
}

.logo {
    font-size: 1.2rem;
    font-weight: 600;
    color: #f1f5f9;
}

.current-atom {
    flex: 1;
    text-align: center;
}

.current-atom span {
    font-size: 1.1rem;
    font-weight: 500;
    color: #e2e8f0;
}

.header-controls {
    display: flex;
    gap: 12px;
}

.join-btn {
    padding: 8px 16px;
    background: #059669;
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.join-btn:hover {
    background: #047857;
    transform: translateY(-1px);
}

.reset-btn {
    padding: 8px 16px;
    background: #dc2626;
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-btn:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

/* Content */
.content {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - 60px);
}

/* Sidebar */
.sidebar {
    width: clamp(300px, 25vw, 400px);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    margin: 8px;
    padding: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.sidebar h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 16px;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.elements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 6px;
    margin-bottom: 16px;
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    align-content: start;
}

.element {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    padding: 10px 6px;
    text-align: center;
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
    backdrop-filter: blur(10px);
}

.element:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.element:active {
    cursor: grabbing;
    transform: scale(1.05);
}

.element.selected {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.3);
    color: white;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.element-symbol {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 3px;
    color: #3b82f6;
}

.element-number {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-bottom: 4px;
    color: #e2e8f0;
}

.element-name {
    font-size: 0.65rem;
    opacity: 0.9;
    color: #cbd5e1;
}

.atom-stats {
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    margin-top: auto;
    backdrop-filter: blur(10px);
}

.atom-stats h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 16px;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    padding: 8px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.stat-item .label {
    font-size: 0.75rem;
    color: #cbd5e1;
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-item .value {
    font-size: 1rem;
    font-weight: 600;
    color: #3b82f6;
}

/* Main Area */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #000000;
}

.canvas-area {
    flex: 1;
    background: #000000;
    position: relative;
}

.controls {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    background: rgba(26, 26, 26, 0.95);
    padding: 14px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid #2a2a2a;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.btn-add {
    background: #059669;
    color: white;
}

.btn-add:hover {
    background: #047857;
    transform: translateY(-1px);
}

.btn-remove {
    background: #dc2626;
    color: white;
}

.btn-remove:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #64748b;
    opacity: 1;
    transition: all 0.3s ease;
    pointer-events: none;
}

.empty-state.hidden {
    opacity: 0;
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
    font-weight: 400;
}

/* Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) translateX(0px) rotate(0deg);
        opacity: 0.4;
    }
    25% {
        transform: translateY(-60px) translateX(40px) rotate(90deg);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-100px) translateX(-30px) rotate(180deg);
        opacity: 0.3;
    }
    75% {
        transform: translateY(-40px) translateX(-60px) rotate(270deg);
        opacity: 0.6;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 40vh;
    }
    
    .elements-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    }
}