body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #121212;
    color: white;
    display: flex;
    justify-content: center;
}

.grid-container{
    display: grid;
    grid-template-columns: repeat(18, 60px); 
    grid-template-rows: repeat(10, 60px);    
    gap: 4px;
    margin-top: 20px;
}

.element{
    background-color: #2c3e50;
    border: 1px solid #34495e;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    font-size: 12px;
    position: relative;
}

.element:hover{
    transform: scale(1.2);
    z-index: 10;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.symbol{
    font-size: 18px;
    font-weight: bold;
}

.number{
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 9px;
    opacity: 0.7;
}

/* Existing styles */
.alkali { 
    background-color: #e74c3c; 
    color: white;
}

.alkaline {
    background-color: #e67e22; 
    color: white;
}

.transition { 
    background-color: #f1c40f; 
    color: black; 
}

.post-transition {
    background-color: #2ecc71;
    color: white;
}

.metalloid {
    background-color: #1abc9c;
    color: white;
}

.nonmetal {
    background-color: #3498db;
    color: white;
}

.halogen {
    background-color: #9b59b6;
    color: white;
}

.noble {
    background-color: #34495e;
    color: white;
}

.lanthanide {
    background-color: #f39c12;
    color: white;
}

.actinide {
    background-color: #d35400;
    color: white;
}

.hidden{ 
    display: none; 
    visibility: hidden;
}

.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: 100;
}

.modal-content{
    background: #333;
    padding: 20px;
    border-radius: 8px;
    min-width: 300px;
    text-align: center;
}

#close-btn{
    float: right;
    cursor: pointer;
    font-size: 20px;
}

.tools-wrapper {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    padding: 20px;
}

.tool-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    width: 250px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 1px solid #e0e0e0;
}

.tool-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.tool-card i {
    font-size: 2.5rem;
    color: #3498db;
    margin-bottom: 15px;
}

.tool-card h3 {
    margin: 10px 0;
    font-size: 1.2rem;
    color: #2c3e50;
}

.tool-card p {
    font-size: 0.9rem;
    color: #7f8c8d;
}