
*{
    margin: 0 ;
    padding: 0;

    box-sizing: border-box; 

}

body {

    min-height: 100vh;

    background: radial-gradient(rgba(46, 36, 24, 0.03) 1px, transparent 1px) #F3EBDA;

    background-size: 3px 3px, auto;

    color: #2E2418;

    font-family: 'EB Garamond', Georgia, serif;
    display: flex;
    flex-direction: column; 

    align-items: center; 
    padding: 30px;

}

#plate-column {

    display: flex;
    flex-direction: column;
    align-items: center;

}

.control > span:first-child {
    color: #5C5240;
    margin-right: 4px;

    font-family: 'EB Garamond', serif;
    font-variant: small-caps;

    font-size: 14px;

    
}
#app {

    display: flex; 
    position: relative;

    width: 1400px;
    max-width: 100%;

    align-items: flex-start;
    justify-content: center;
    gap: 44px;


}
#caption {

    font-family: 'EB Garamond', serif;
    font-size: 15px;
    color: #5C5240;

    line-height: 1.5;
    width: 800px;

    max-width: 100%;

    margin-top: 14px;
    padding-top: 12px;

    border-top: 1px solid #D9C9A8;

    display: flex;
    align-items: baseline;
    gap: 12px;

    

}

#caption-text {
    flex: 1;
}

#main-panel {   

    width: 800px; 

    height: 600px;
}

#background {
    
    background: #FBF6EC;
    border: 1px solid #2E2418;

    outline: 1px solid #B08D57;
    outline-offset: 4px;

    display: block;

    width: 800px;

    height: 600px;
    border-radius: 0;

       
}


#info-panel {

    position: relative;
    top: 40px;
    flex-shrink: 0;

    min-width: 210px;

    padding: 16px 18px;
    background: #FBF6EC;

    border: 1px solid #2E2418;
    outline: 1px solid #B08D57;
    outline-offset: 3px;
    border-radius: 0;

    transform: rotate(-1.4deg);

    

}


#info-panel::before {

    width: 13px;
    height: 13px;

    border-radius: 50%;
    content: "";
    position: absolute;
    top: -8px;
    left: 26px;

    
    background: #B08D57;
    box-shadow: 0 2px 3px rgba(46, 36, 24, 0.35);

}
#element-name {


    color: #2E2418;
    font-style: italic;
    font-family: 'Fraunces', serif;
    font-weight: 500;
    font-size: 16px;
}

#element-symbol {

    font-size: 28px;

    line-height: 1;
    flex-shrink: 0;

    font-family: 'Fraunces', serif;
    font-weight: 600;

    color: #2E2418;
    border: 1px solid #B08D57;
    min-width: 44px;
    width: auto;
    height: 44px;
    padding: 0 9px;
    display: flex;
    align-items: center;

    justify-content: center;
    white-space: nowrap;
}



#caption-text span {

    color: #2E2418;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 13px;

}
#isotope-panel h2 {

    font-size: 15px;

    font-variant: small-caps;
    letter-spacing: 1px;

    font-family: 'EB Garamond', serif;

    color: #5C5240;
    margin-bottom: 9px;

}
#info-panel p span {

    color: rgb(255, 255, 255);

    font-weight: 600;
     
}


#isotope-panel {
    
    background: #FBF6EC;
    border: 1px solid #2E2418;

    outline: 1px solid #B08D57;
    outline-offset: 3px;
    border-radius: 0;

    padding: 20px;
    width: 230px;
    flex-shrink: 0;

    height: 600px;
    overflow-y: auto;

    position: relative;
    align-self: flex-start;


}




#isotope-name {

    font-size: 26px;
    font-family: 'Fraunces', serif;
    font-style: italic;

    font-weight: 500;
    margin-bottom: 16px;

    border-bottom: 1px solid #D9C9A8;
    padding-bottom: 14px;

    color: #2E2418;
    letter-spacing: 0.3px;

}

.property {
    
    border-bottom: 1px dotted #D9C9A8;
    font-size: 13px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 10px 0;
    gap:24px
    

}

.property span:first-child {

    font-weight: normal;

    color: #5C5240;
    font-variant: small-caps;

    letter-spacing: 0.3px;
    font-size: 14px;
    font-family: 'EB Garamond', serif;

}

.property span:last-child {

    text-align: right;
    color: #2E2418;
    font-family: 'JetBrains Mono', monospace;

    font-weight: 600;
    font-size: 13px;

}
#controls {

    width: 1074px;
    max-width: 100%;

    margin-top: 26px;

    display: flex;
    justify-content: space-evenly;

    background: #FBF6EC;
    border: 1px solid #2E2418;
    outline: 1px solid #B08D57;
    outline-offset: 3px;


}


.control {


    background: transparent;
    border: none;
    border-left: 1px solid #D9C9A8;
    flex: 1;

    padding: 16px 24px;
    display: flex;

    align-items: center;
    justify-content: center;
    gap: 10px;

}
.control:first-child {
    border-left: none;
}
.control button {
    width: 28px;
    height: 28px;

    border: 1.5px solid #B08D57;
    border-radius: 50%;

    background: #FBF6EC;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer; 

    color: #2E2418;
    font-family: 'JetBrains Mono', monospace;

    transition:

        background 0.15s ease,
        transform 0.1s ease,
        box-shadow 0.15s ease;

}

.control button:hover {

    background: #D9C08A;
    color: #2E2418;
    box-shadow: 0 0 0 3px rgba(176, 141, 87, 0.15);

}

.control button:active {

    transform: scale(0.92);
    box-shadow: inset 0 1px 3px rgba(46, 36, 24, 0.4);
}

#periodic-table h2 {

    font-size: 24px;
    margin-bottom: 20px; 

}
.control > span:last-child {

    min-width: 25px;


    text-align: center;  

    font-weight: bold;
}

.element-box {


    width: 100%;
    height: 100%;
    padding: 0;
    position: relative;

    border-radius: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;

    font-weight: 600;
    cursor: pointer;

    border: 1px solid #D9C9A8;
    background: #F3EBDA;
    color: #2E2418;


    transition:

        transform 0.15s ease,
        background 0.15s ease;
}





#element-grid { 

    display: grid;

    grid-template-columns: repeat(18, minmax(0, 1fr)); 
    grid-template-rows: repeat(9, 48px);

    gap: 4px; 

}
 


.element-box:hover {

    transform: translateY(-1px);
    background: #FBF6EC;
    border-color: #B08D57;



}




.element-box:active {

    transform: scale(0.98);

}

.element-box::after {

    content: "";

    position: absolute;
    top: 3px;

    right: 3px;
    width: 5px;
    height: 5px;

    border-radius: 50%;
    background: var(background, #B08D57);
}

#periodic-table h2 {

    font-style: italic;
    font-size: 22px;
    font-family: 'Fraunces', serif;
    
    font-weight: 500;
    margin-bottom: 16px;

    color: #2E2418;
    padding-bottom: 12px;

    border-bottom: 1px solid #D9C9A8;
}

#periodic-table-toggle {

    font-family: 'EB Garamond', serif; 
    font-variant: small-caps;
    font-size: 17px;
 
    font-weight: 600;


    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;

    position: fixed;
    top: 50%;
    right: 0;
    z-index: 50;

    writing-mode: vertical-rl;
    width: 44px;
    height: 150px;
    padding: 0;

    border: 1.5px solid #B08D57;
    border-right: none;
    border-radius: 8px 0 0 8px; 

    background: #FBF6EC;
    color: #2E2418;

    transform: translateY(-50%) translateX(0);
    transition: 

        background 0.15s ease,  

        transform 0.15s ease;


}


#periodic-table-toggle:hover {

    background: #D9C08A;
    transform: translateY(-50%) translateX(-6px);

}

#periodic-table-toggle:active {

    transform: translateY(-50%) translateX(-6px);

}



.element-box.alkali-metal{
    background: #7A1F2B; 
}
.element-box.alkaline-earth-metal { 
    background: #A6541E; 
}
.element-box.transition-metal{
    background: #B08D57; 
}
.element-box.post-transition-metal { 
    background: #4C6B4F; 
}
.element-box.metalloid{
    background: #2E6B6B; 
}
.element-box.nonmetal{
    background: #1F3A5F; 
}
.element-box.halogen{
    background: #5C3A6B; 
}
.element-box.noble-gas{
    background: #7A3A5C; 
}
.element-box.lanthanide{ 
    background: #8A6D2F; 
}
.element-box.actinide{
    background: #3D6647;
}

.control input {

    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;

    font-weight: 600;

    outline: none;    

    background: #F3EBDA;
    color: #2E2418;
    text-align: center;

    width: 45px; 

    height: 30px;
    padding: 0;

    border: 1px solid #D9C9A8;
    border-radius: 0;
    

}



.control input::-webkit-inner-spin-button,

.control input::-webkit-outer-spin-button {

    -webkit-appearance: none;
    margin: 0;

}

.control input:focus {

    border-color: #B08D57;
    box-shadow: 0 0 0 2px rgba(176, 141, 87, 0.15);
}

#periodic-table {

    display: none;

    position: fixed;
    top: 0;
    right: 0;

    width: 780px;
    max-width: 90vw;
    height: 100vh;

    overflow: auto;

    padding: 28px;
    background: #FBF6EC;
    border-left: 1px solid #2E2418;
    outline: 1px solid #B08D57;
    outline-offset: -6px;
    border-radius: 0;
    z-index: 100;

    transform: translateX(100%);
    transition: transform 0.35s ease;
}


#periodic-table.open { 
    
    transform: translateX(0);
}




#periodic-backdrop {

    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 4, 9, 0.72);
    backdrop-filter: blur(3px);
    z-index: 99;

}
.element-box {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1;
}

.element-box {
    color: rgb(200, 204, 220);
}
.element-box.selected {

    background: #2E2418;
    border-color: #B08D57;
    color: #FBF6EC;

}
.element-box.selected::after {
    background: #D9C08A;
}

#periodic-table::-webkit-scrollbar {
    width: 6px;
}

#periodic-table::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

#periodic-table::-webkit-scrollbar-thumb {

    background: rgba(170, 175, 185, 0.22);
    border-radius: 3px;
}


#periodic-table::-webkit-scrollbar-thumb:hover {
    
    background: rgba(210, 215, 225, 0.4);

}
#isotope-name.invalid {
    color: #d07253;
}
#page-heading {
    text-align: center;
    margin-bottom: 22px;
}

#page-heading h1 {
    
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 500;

    font-size: 34px;
    margin: 0;
    
    letter-spacing: 1px;
    color: #2E2418;
}

#page-heading p {

    font-size: 15px;
    letter-spacing: 2px;
    color: #5C5240;

    margin: 8px 0 0;
    font-family: 'EB Garamond', serif;

    font-variant: small-caps;
    
}



