body {
    background-color: #0a0f1e; color: #f8fafc;
    font-family: 'Segoe UI', sans-serif; margin: 0;
    height: 100vh; width: 100vw; display: flex;
    align-items: center; justify-content: center;
    overflow: hidden; touch-action: none;
}

#app-scaler {
    width: 1280px; height: 720px;
    display: flex; flex-direction: column; transform-origin: center center;
}

#main-header h1 { margin: 10px 0; font-size: 2.2rem; letter-spacing: 8px; text-align: center; color: #38bdf8; }
#main-container { display: flex; width: 100%; flex: 1; align-items: center; padding: 0 20px; }

/* Sidebar & Petit Tableau */
#left-sidebar { width: 30%; display: flex; flex-direction: column; align-items: center; }
#periodic-table { display: grid; grid-template-columns: 1fr 1fr 30px 1fr 1fr 1fr 1fr 1fr 1fr; gap: 6px; width: 100%; }
.element-box {
    aspect-ratio: 1; border: 1px solid #334155;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.03); cursor: pointer;
}
.element-box span { font-size: 0.8rem; color: #94a3b8; }
.element-box strong { font-size: 1.3rem; }
.element-box.active { background-color: #38bdf8; color: #0f172a; font-weight: bold; box-shadow: 0 0 15px #38bdf8; }

#btn-full-table {
    margin-top: 20px; padding: 15px; width: 100%; background: #1e293b; color: white;
    border: 1px solid #38bdf8; border-radius: 8px; cursor: pointer; font-weight: bold; font-size: 1rem;
}

/* Zone de construction */
#builder-zone { width: 40%; display: flex; flex-direction: column; align-items: center; }
#atomCanvas { max-height: 55vh; width: auto; }
#controls { margin-top: 15px; display: flex; flex-direction: column; gap: 8px; width: 80%; }
.control-group {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(255,255,255,0.07); padding: 8px 15px; border-radius: 50px;
}
.control-group label { font-size: 1.1rem; font-weight: bold; flex: 1; text-align: center; }
#controls button { width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer; color: white; font-size: 1.5rem; }

/* Infos & Notation */
#info-zone { width: 30%; display: flex; flex-direction: column; align-items: center; }
#atom-name-title { font-size: 2.8rem; margin: 0; color: #38bdf8; }
#stability-info { font-weight: bold; font-size: 1.2rem; height: 1.5rem; margin-top: 5px; }
.stable { color: #4ade80; } .instable { color: #ef4444; }
#notation-container { font-family: 'Times New Roman', serif; font-size: 5.5rem; display: flex; align-items: center; margin: 10px 0; }
.indices { display: flex; flex-direction: column; font-size: 1.8rem; text-align: right; margin-right: 12px; line-height: 0.9; }
.charge-exposant { font-size: 2.2rem; align-self: flex-start; color: #fbbf24; font-weight: bold; }

/* MODALE MINIATURE */
#modal-table {
    display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.9); justify-content: center; align-items: center;
}
#modal-content {
    position: relative; width: 90%; max-width: 850px; background: #0f172a;
    padding: 15px; border-radius: 10px; border: 1px solid #38bdf8;
}
#close-modal { position: absolute; top: 0; right: 15px; color: white; font-size: 35px; cursor: pointer; }
#modal-content h2 { text-align: center; font-size: 1.2rem; margin: 0 0 10px 0; color: #38bdf8; }

#full-table-grid { display: grid; grid-template-columns: repeat(18, 1fr); gap: 1px; }
.full-cell {
    aspect-ratio: 0.75; border: 1px solid #2d3748; background: #1e293b;
    display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1px;
}
.full-cell span { font-size: 0.45rem; color: #94a3b8; }
.full-cell strong { font-size: 0.85rem; color: #38bdf8; }
.full-cell em { font-style: normal; font-size: 0.35rem; color: #f8fafc; overflow: hidden; white-space: nowrap; max-width: 100%; }