:root {
    --bg-gradient: linear-gradient(135deg, #e0f2fe, #f0fdf4);
    --panel-bg: rgba(255, 255, 255, 0.85);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --primary: #84cc16;
    --primary-hover: #65a30d;
    --accent-blue: #0ea5e9;
    --accent-yellow: #eab308;
}

body { 
    margin: 0; 
    padding: 20px; 
    font-family: 'Inter', sans-serif; 
    background: var(--bg-gradient); 
    color: var(--text-main); 
    min-height: 100vh; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
}

/* --- MODAL OVERLAYS --- */
.modal-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(15, 23, 42, 0.6); 
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px); 
    z-index: 10000; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    opacity: 0; 
    transition: opacity 0.2s; 
    pointer-events: none; 
}

.modal-overlay.active { 
    opacity: 1; 
    pointer-events: auto; 
}

.custom-modal-box { 
    background: white; 
    border-radius: 24px; 
    padding: 35px 30px; 
    width: 90%; 
    max-width: 400px; 
    box-shadow: 0 20px 40px rgba(0,0,0,0.2); 
    text-align: center; 
    transform: translateY(20px); 
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    position: relative; 
}

.modal-overlay.active .custom-modal-box { 
    transform: translateY(0); 
}

.workspace-modal { 
    max-width: 800px; 
    padding: 40px; 
    text-align: left; 
    max-height: 90vh; 
    overflow-y: auto; 
}

.workspace-modal::-webkit-scrollbar { width: 8px; }
.workspace-modal::-webkit-scrollbar-track { background: transparent; }
.workspace-modal::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.custom-modal-box h2 { 
    font-family: 'Nunito', sans-serif; 
    font-weight: 900; 
    color: #1e293b; 
    margin: 0 0 10px 0; 
    font-size: 1.5rem; 
}

.custom-modal-box p { 
    color: #64748b; 
    font-size: 0.95rem; 
    margin-bottom: 25px; 
    line-height: 1.5; 
}

.custom-modal-actions { 
    display: flex; 
    gap: 10px; 
    justify-content: center; 
}

.custom-modal-actions .btn { 
    padding: 12px; 
    font-size: 0.95rem; 
    flex: 1; 
}

.close-btn { 
    position: absolute; 
    top: 15px; 
    right: 20px; 
    background: none; 
    border: none; 
    font-size: 1.5rem; 
    color: #94a3b8; 
    cursor: pointer; 
    transition: 0.2s; 
    padding: 0; 
    line-height: 1; 
    z-index: 10; 
}

.close-btn:hover { color: #ef4444; }

/* --- AUTH SPECIFIC --- */
.btn-google { 
    background: #fff; 
    border: 2px solid #e2e8f0; 
    color: #475569; 
    padding: 12px; 
    border-radius: 12px; 
    width: 100%; 
    font-weight: bold; 
    cursor: pointer; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 10px; 
    transition: 0.2s; 
    margin-bottom: 15px; 
}

.btn-google:hover { 
    background: #f8fafc; 
    border-color: #cbd5e1; 
}

.auth-divider { 
    display: flex; 
    align-items: center; 
    text-align: center; 
    color: #94a3b8; 
    font-size: 0.85rem; 
    margin: 15px 0; 
}

.auth-divider::before, .auth-divider::after { 
    content: ''; 
    flex: 1; 
    border-bottom: 1px solid #e2e8f0; 
}
.auth-divider::before { margin-right: .5em; } 
.auth-divider::after { margin-left: .5em; }

#auth-error-msg { 
    color: #ef4444; 
    font-size: 0.85rem; 
    font-weight: bold; 
    margin-top: 15px; 
    height: 20px; 
}

#btn-dev-bypass { 
    margin-top: 20px; 
    font-size: 0.75rem; 
    color: #94a3b8; 
    cursor: pointer; 
    text-decoration: underline; 
    transition: color 0.2s; 
    display: inline-block; 
}

#btn-dev-bypass:hover { color: #475569; }

/* --- DASHBOARD UI --- */
#dashboard-content { 
    display: flex; 
    width: 100%; 
    max-width: 1200px; 
    flex-direction: column; 
    align-items: center;
}

.header { 
    width: 100%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 30px; 
    padding: 10px 20px; 
    box-sizing: border-box; 
}

.logo-section h1 { 
    font-family: 'Nunito', sans-serif; 
    font-weight: 900; 
    color: #334155; 
    margin: 0; 
    font-size: 1.8rem; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

.profile-pill { 
    background: var(--panel-bg); 
    padding: 8px 16px; 
    border-radius: 50px; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    backdrop-filter: blur(10px); 
    border: 1px solid rgba(255,255,255,0.5); 
    font-weight: 600; 
    font-size: 0.9rem; 
    cursor: pointer; 
    transition: 0.2s; 
}

.profile-pill:hover { 
    background: #fef2f2; 
    color: #ef4444; 
    border-color: #fca5a5; 
}

.dashboard-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 30px; 
    width: 100%; 
    align-items: start; 
}

.column { 
    display: flex; 
    flex-direction: column; 
    gap: 30px; 
}

.glass-panel { 
    background: var(--panel-bg); 
    backdrop-filter: blur(16px); 
    border: 1px solid rgba(255, 255, 255, 0.6); 
    border-radius: 24px; 
    padding: 30px; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05); 
    position: relative; 
}

h2 { 
    font-family: 'Nunito', sans-serif; 
    font-weight: 800; 
    margin-top: 0; 
    color: #1e293b; 
    font-size: 1.4rem; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

.section-label { 
    font-weight: 700; 
    font-size: 0.95rem; 
    margin-bottom: 12px; 
    color: #475569; 
    display: flex; 
    justify-content: space-between; 
}

.pro-badge { 
    background: linear-gradient(45deg, #fef08a, #fde047); 
    color: #854d0e; 
    padding: 4px 12px; 
    border-radius: 20px; 
    font-weight: 800; 
    font-size: 0.75rem; 
    box-shadow: 0 4px 10px rgba(253, 224, 71, 0.3); 
}

/* Custom Icon Mission Focus */
.focus-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 10px; 
    margin-bottom: 25px; 
}

.focus-card { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    padding: 15px 5px; 
    border-radius: 12px; 
    border: 2px solid transparent; 
    cursor: pointer; 
    transition: 0.2s; 
    font-weight: 600; 
    font-size: 0.8rem; 
    color: #475569; 
    text-align: center; 
    gap: 8px;
}

.focus-card:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.focus-card input[type="radio"] { display: none; }
.custom-icon { width: 45px; height: 45px; object-fit: contain; }

.card-all { background: #f3e8ff; } .card-all.active { border-color: #a855f7; }
.card-earth { background: #e0f2fe; } .card-earth.active { border-color: #0ea5e9; }
.card-gas { background: #fef08a; } .card-gas.active { border-color: #ca8a04; }
.card-ice { background: #e0f2fe; } .card-ice.active { border-color: #0ea5e9; }
.card-moon { background: #fef08a; } .card-moon.active { border-color: #ca8a04; }
.card-dwarf { background: #f1f5f9; } .card-dwarf.active { border-color: #64748b; }

.text-input { 
    width: 100%; 
    padding: 12px; 
    border-radius: 10px; 
    border: 1px solid #cbd5e1; 
    background: #fff; 
    color: #1e293b; 
    font-size: 0.95rem; 
    font-family: 'Inter', sans-serif; 
    box-sizing: border-box; 
    transition: 0.2s; 
    margin-bottom: 15px; 
}
.text-input:focus { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2); }

/* Buttons */
.btn { border: none; padding: 15px; border-radius: 12px; font-size: 1rem; font-weight: 800; font-family: 'Nunito', sans-serif; cursor: pointer; transition: 0.2s; width: 100%; display: flex; justify-content: center; align-items: center; gap: 8px;}
.btn-green { background: var(--primary); color: white; box-shadow: 0 4px 15px rgba(132, 204, 22, 0.3); }
.btn-green:hover { background: var(--primary-hover); transform: translateY(-2px); }
.btn-blue { background: var(--accent-blue); color: white; box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3); }
.btn-blue:hover { background: #0284c7; transform: translateY(-2px); }
.btn-yellow { background: var(--accent-yellow); color: white; box-shadow: 0 4px 15px rgba(234, 179, 8, 0.3); }
.btn-yellow:hover:not(:disabled) { background: #ca8a04; transform: translateY(-2px); }
.btn-red { background: #ef4444; color: white; }
.btn-red:hover { background: #dc2626; }
.btn-action { padding: 10px 15px; border-radius: 8px; font-weight: bold; cursor: pointer; border: none; font-size: 0.9rem; transition: 0.2s; }

.output-box { background: #f0f9ff; border: 2px dashed #7dd3fc; padding: 20px; border-radius: 16px; display: none; flex-direction: column; gap: 15px; margin-top: 20px; }
.url-output { display: block; width: 100%; padding: 12px; background: #fff; color: #0369a1; border: 1px solid #bae6fd; border-radius: 8px; font-family: monospace; font-size: 0.9rem; box-sizing: border-box; word-break: break-all; text-decoration: none; }

/* Pro Launcher Cards */
.launcher-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; width: 100%; }
.launcher-card { background: white; border: 2px solid #e2e8f0; border-radius: 16px; padding: 20px; display: flex; align-items: center; gap: 20px; cursor: pointer; transition: 0.2s; position: relative; overflow: hidden; }
.launcher-card:hover { border-color: var(--accent-blue); box-shadow: 0 10px 25px rgba(14, 165, 233, 0.15); transform: translateY(-3px); }
.launcher-icon { font-size: 2.5rem; background: #f1f5f9; width: 60px; height: 60px; display: flex; justify-content: center; align-items: center; border-radius: 12px; flex-shrink: 0;}
.launcher-card.pro-locked:hover { border-color: #cbd5e1; box-shadow: none; transform: none; cursor: default;}
.lock-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.6); display: flex; justify-content: center; align-items: center; font-size: 2rem; z-index: 10; opacity: 0; transition: 0.2s; }
.launcher-card.pro-locked .lock-overlay { opacity: 1; }
.launcher-card h3 { margin: 0 0 5px 0; color: #1e293b; font-family: 'Nunito', sans-serif; font-size: 1.1rem; }
.launcher-card p { margin: 0; color: #64748b; font-size: 0.85rem; }

/* 🔬 DUAL DROPZONE STYLES */
.drop-zone { background: #f8fafc; border: 2px dashed #cbd5e1; border-radius: 12px; padding: 20px; text-align: center; cursor: pointer; transition: 0.2s; color: #64748b; font-weight: bold; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80px;}
.drop-zone:hover, .drop-zone.dragover { background: #f0f9ff; border-color: var(--accent-blue); color: var(--accent-blue); }
.drop-zone.loaded { background: #f0fdf4; border-color: #10b981; border-style: solid; color: #10b981; pointer-events: none;}

.stats-panel { background: #f1f5f9; border-radius: 12px; padding: 15px; font-size: 0.85rem; color: #334155; max-height: 300px; overflow-y: auto;}
.stats-panel strong { color: #0f172a; display: inline-block; width: 100px;}
.stats-panel p { margin: 6px 0; }

.room-code-display { background: #fff; border: 2px dashed var(--accent-blue); padding: 20px; text-align: center; border-radius: 16px; margin-bottom: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.02); position: relative;}
.live-dot { position: absolute; top: 15px; right: 15px; width: 12px; height: 12px; background: #10b981; border-radius: 50%; box-shadow: 0 0 10px #10b981; animation: pulse 1.5s infinite; }
.player-card { background: #fff; border: 1px solid #e2e8f0; padding: 15px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; border-left: 5px solid #cbd5e1; margin-bottom: 10px; transition: 0.3s; }
.player-card.finished { border-left-color: #10b981; background: #ecfdf5; border-color: #10b981;}
@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.2); opacity: 0.7; } 100% { transform: scale(1); opacity: 1; } }

@media (max-width: 900px) { 
    .dashboard-grid { grid-template-columns: 1fr; } 
    .focus-grid { grid-template-columns: 1fr 1fr; } 
    .launcher-grid { grid-template-columns: 1fr; } 
}

/* ==========================================
   🧪 MASTER PERIODIC TERMINAL STYLES
   ========================================== */
.periodic-terminal-body {
    display: flex; flex: 1; overflow: hidden;
}
.terminal-left-pane {
    flex: 2; overflow: auto; padding: 20px;
    background: #0B0E14; border-right: 1px solid #1e293b;
}
.terminal-right-pane {
    flex: 1; min-width: 350px; max-width: 450px; 
    background: radial-gradient(circle at top right, #1e293b 0%, #0B0E14 100%);
    padding: 30px; overflow-y: auto;
}

.periodic-grid {
    display: grid; 
    grid-template-columns: repeat(18, minmax(38px, 1fr));
    gap: 6px; /* 👈 Increased gap for breathing room! */
    min-width: 850px; 
    padding-bottom: 20px;
}

/* Base Element cell styles */
.el-cell {
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    background: rgba(15, 23, 42, 0.8); border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px; /* Slightly rounder corners */
    padding: 4px; cursor: pointer; position: relative;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); aspect-ratio: 1/1.1;
}
.el-cell:hover { transform: scale(1.3); z-index: 10; box-shadow: 0 10px 25px rgba(0,0,0,0.8); }
.el-num { font-size: 0.55rem; color: #94A3B8; font-family: monospace; font-weight: bold; position: absolute; top: 2px; left: 4px; }
.el-sym { font-size: 1.1rem; font-weight: 900; font-family: 'Nunito', sans-serif; align-self: center; margin-top: 6px; }
.el-name { font-size: 0.45rem; color: #94A3B8; text-transform: uppercase; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* 🔴 ADDED: Category Highlight Colors */
.cat-nonmetal { border-bottom: 3px solid #38bdf8; color: #38bdf8; }
.cat-nonmetal:hover { background: rgba(56, 189, 248, 0.1); border-color: #38bdf8; box-shadow: 0 0 15px rgba(56, 189, 248, 0.4); }

.cat-noble { border-bottom: 3px solid #c084fc; color: #c084fc; }
.cat-noble:hover { background: rgba(192, 132, 252, 0.1); border-color: #c084fc; box-shadow: 0 0 15px rgba(192, 132, 252, 0.4); }

.cat-alkali { border-bottom: 3px solid #f87171; color: #f87171; }
.cat-alkali:hover { background: rgba(248, 113, 113, 0.1); border-color: #f87171; box-shadow: 0 0 15px rgba(248, 113, 113, 0.4); }

.cat-alkaline { border-bottom: 3px solid #fb923c; color: #fb923c; }
.cat-alkaline:hover { background: rgba(251, 146, 60, 0.1); border-color: #fb923c; box-shadow: 0 0 15px rgba(251, 146, 60, 0.4); }

.cat-transition { border-bottom: 3px solid #facc15; color: #facc15; }
.cat-transition:hover { background: rgba(250, 204, 21, 0.1); border-color: #facc15; box-shadow: 0 0 15px rgba(250, 204, 21, 0.4); }

.cat-metalloid { border-bottom: 3px solid #2dd4bf; color: #2dd4bf; }
.cat-metalloid:hover { background: rgba(45, 212, 191, 0.1); border-color: #2dd4bf; box-shadow: 0 0 15px rgba(45, 212, 191, 0.4); }

.cat-post-transition { border-bottom: 3px solid #4ade80; color: #4ade80; }
.cat-post-transition:hover { background: rgba(74, 222, 128, 0.1); border-color: #4ade80; box-shadow: 0 0 15px rgba(74, 222, 128, 0.4); }

/* 🔴 ADD THESE TWO NEW CATEGORIES TO YOUR CSS */
.cat-lanthanide { border-bottom: 3px solid #a78bfa; color: #a78bfa; }
.cat-lanthanide:hover { background: rgba(167, 139, 250, 0.1); border-color: #a78bfa; box-shadow: 0 0 15px rgba(167, 139, 250, 0.4); }

.cat-actinide { border-bottom: 3px solid #f472b6; color: #f472b6; }
.cat-actinide:hover { background: rgba(244, 114, 182, 0.1); border-color: #f472b6; box-shadow: 0 0 15px rgba(244, 114, 182, 0.4); }

/* Data Stat Boxes in Right Pane */
.el-stat-box { display: flex; flex-direction: column; background: #0f172a; padding: 12px; border-radius: 8px; border: 1px solid #1e293b; }
.stat-label { font-size: 0.65rem; text-transform: uppercase; font-weight: bold; color: #64748b; margin-bottom: 4px; }
.stat-val { font-size: 1rem; font-weight: 900; color: #e2e8f0; font-family: monospace; }

/* 🔴 ADDED: 2D Dynamic Bohr Atom Animation Classes */
.atom-container { 
    width: 250px; height: 250px; position: relative; 
    display: flex; justify-content: center; align-items: center;
}
.nucleus { 
    width: 30px; height: 30px; border-radius: 50%; 
    position: absolute; z-index: 100;
    box-shadow: 0 0 25px currentColor; 
}
.electron-shell { 
    position: absolute; border: 2px solid rgba(255,255,255,0.15); 
    border-radius: 50%; 
    animation: spinShell linear infinite; 
}
.electron { 
    width: 8px; height: 8px; background: #fff; border-radius: 50%; 
    position: absolute; 
    box-shadow: 0 0 8px #fff; 
}
@keyframes spinShell { 
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); } 
}

/* Mobile behavior: Stack the panes vertically */
@media (max-width: 900px) {
    .periodic-terminal-body { flex-direction: column; }
    .terminal-left-pane { flex: 1; border-right: none; border-bottom: 1px solid #1e293b; }
    .terminal-right-pane { flex: 1; max-width: 100%; }
}

