html,
body {
    background: rgb(84, 84, 84);
    font-family: 'Comfortaa';
    width: min-content;
    height: min-content;
    margin: 0 auto;
}

#table {
    display: grid;
    width: min-content;
    height: min-content;
    grid-template-columns: repeat(19, 1fr);
    grid-template-rows: repeat(7, 1fr);
    border-radius: 15px;
    gap: 2px;
    padding: 30px;
    margin-top: 30px;
    background: #70707053;
}

.element {
    cursor: pointer;
    width: 50px;
    height: 50px;
    border: 2px solid rgba(246, 246, 246, 0.5);
    border-radius: 10%;
    display: inline-block;
    text-align: center;
    vertical-align: middle;
    position: relative;
    color: #FFFFFF;
    transition: all cubic-bezier(0.165, 0.84, 0.44, 1) 0.25s;
    animation: z-index-delay-out 0.2s linear forwards;
}

#table.disabled {
    cursor: default;
    animation: none;
    pointer-events: none;
}

#table.disabled .element{
    color: #ffffff37;
    cursor: default;
    animation: none;
}

.element.non-highlight {
    transform: scale(0.85) !important;
    background-color: #6d6d6d;
    animation: z-index-delay-out 0.2s linear forwards;
}

.element.highlight {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    animation: z-index-delay-in 0s linear forwards;
}

.element:hover {
    transform: scale(4);
    border-width: 0.5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    animation: z-index-delay-in 0s linear forwards;
}

#table.draggable .element div{
    color: #00000000;
    visibility: collapse;

}

#table.draggable .element:hover{
    transform: scale(1);
    border-width: 2px;
    box-shadow: 0px 0px #00000000;
}

@keyframes z-index-delay-in {
    0% {
        z-index: 0;
    }

    50% {
        z-index: 2;
    }

    100% {
        z-index: 5;
    }
}

@keyframes z-index-delay-out {
    0% {
        z-index: 5;
    }

    50% {
        z-index: 2;
    }

    100% {
        z-index: 0;
    }
}

.name,
.symbol,
.atomic-mass,
.atomic-number,
.protons,
.neutrons,
.classification {
    transition: all cubic-bezier(0.165, 0.84, 0.44, 1) 0.25s;
}


.name,
.atomic-mass,
.protons,
.neutrons,
.classification {
    visibility: collapse;
    opacity: 0;
    font-size: 0px;
}

#table:not(.draggable) .element:hover .name,
#table:not(.draggable) .element:hover .atomic-mass,
#table:not(.draggable) .element:hover .protons,
#table:not(.draggable) .element:hover .neutrons,
#table:not(.draggable) .element:hover .classification {
    visibility: visible;
    font-size: 3.5px;
    opacity: 1;
}

.element:hover .name {
    font-size: 4px;
    font-weight: bold;
}

.element:hover .classification {
    padding: 1px 0 2px 0;
}


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

#table:not(.draggable) .element:hover .symbol {
    font-weight: bolder;
    font-size: 8px;
    padding: 3px 0 2px 0;
}



.atomic-number {
    padding-top: 6px;
    font-size: 12px;
}

#table:not(.draggable) .element:hover .atomic-number {
    padding-top: 3px;
    font-size: 4px;
}



.AlkaliMetal {
    background-color: #244d57;
}

.AlkalineEarthMetal {
    background-color: #622e39;
}

.TransitionMetal {
    background-color: #433c65;
}

.Post-transitionMetal {
    background-color: #2f4d47;
}

.Metalloid {
    background-color: #523e1b;
}

.ReactiveNonmetal {
    background-color: #2a4165;
}

.NobleGas {
    background-color: #623842;
}

.Lanthanide {
    background-color: #004a77;
}

.Actinide {
    background-color: #613b28;
}

.Unknown {
    background-color: #46474c;
}

.tab-button {
    text-align: center;
    width: 200px;
    display: inline-block;
    padding: 10px 20px;
    background-color: #bdbdbd;
    cursor: pointer;
    border-radius: 10px 10px 0 0;

}

.tab-button.active {
    background-color: #f0f0f0;
}

.tab-content {
    display: none; 
    padding: 30px;
    border-radius: 0 10px 10px 10px;
    background-color: #f0f0f0;

}

.tab-content.active {
    display: block;
}


.element-groups {
    background-color: #70707053;
    justify-content: space-between;
    padding: 20px 30px;
    border-radius: 10px;
}

.element-group-row {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
}

.element-group {
    flex-basis: calc(30% - 10px);
    padding: 10px 15px;
    background-color: #eee;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all ease-in-out 0.1s;
    box-shadow: 0 7px 15px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(246, 246, 246, 0.5);
}

.element-group:hover {
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.25);
    transform: scale(1.025);
    color: #fff;
}

.element-group.AlkaliMetal:hover {
    background-color: #244d57;
}

.element-group:hover .legend-circle {
    background-color: #ffffff79;
}

.element-group.AlkalineEarthMetal:hover {
    background-color: #622e39;
}

.element-group.TransitionMetal:hover {
    background-color: #433c65;
}

.element-group.Post-transitionMetal:hover {
    background-color: #2f4d47;
}

.element-group.Metalloid:hover {
    background-color: #523e1b;
}

.element-group.ReactiveNonmetal:hover {
    background-color: #2a4165;
}

.element-group.NobleGas:hover {
    background-color: #623842;
}

.element-group.Lanthanide:hover {
    background-color: #004a77;
}

.element-group.Actinide:hover {
    background-color: #613b28;
}

.element-group.Unknown:hover {
    background-color: #46474c;
}

.legend-circle {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
    border: 2px solid rgba(246, 246, 246, 0.5);
}

.mystery-elements {
    margin-top: 20px;
}

.mystery-list {
    background-color: #70707053;
    list-style: none;
    display: flex;
    justify-content: space-between;
    padding-right: 40px;
    border-radius: 10px;
}

.mystery-item {
    width: 50px;
    height: 50px;
    margin: 30px 0;
    background: #f9f9f9;
    border: 2px solid rgba(246, 246, 246, 0.5);
    align-items: center;
    justify-content: center;
    display: flex;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 7px 15px rgba(0, 0, 0, 0.35);
    transition: all cubic-bezier(0.165, 0.84, 0.44, 1) 0.25s;
}

.mystery-item:hover {
    width: 50px;
    height: 50px;
    margin: 30px 0;
    border-radius: 5px;
    background: #000000;
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.5);
}

.element.dropping {
    transform: scale(1.1);
}


.popup {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8);
    box-shadow: 0 7px 15px rgba(0, 0, 0, 0.35);
    color: white;
    padding: 15px;
    border-radius: 5px;
    bottom: 140px;
    width: 300px;
    height: 55px;
    font-size: 14px;
    text-align: center;
    transition: all cubic-bezier(0.165, 0.84, 0.44, 1) 0.25s;
    opacity: 0;
    visibility: hidden;
}

.popup.show {
    opacity: 1;
    visibility: visible;
    transform: translatey(0%) scale(1);
    transition-delay: 0s;
}

.popup.hide {
    opacity: 0;
    visibility: hidden;
    transform: translatey(50%) scale(0.8);
    transition-delay: 1s;
}

.popup .hint-title {
    font-size: 16px;
    font-weight: bold;
    align-items: center;
    justify-content: center;
    display: flex;
    margin-bottom: 5px;
}

.popup .hint {
    align-items: center;
    justify-content: center;
    display: flex;
}

#instructions .instructs {
    padding: 20px;
    background-color: #70707053;
    border-radius: 10px;
}


.bottom {
    list-style: none;
    display: flex;
    background-color: #70707053;
    justify-content: space-between;
    padding-right: 40px;
    border-radius: 10px;
}

.instructs .sep {
    display: grid;
    width: 100%;
    height: 100%;
    grid-template-columns: repeat(2,1fr 1fr);
    grid-template-rows: repeat(1, 1fr);
    border-radius: 15px;
    gap: 15px;
}

.instructs .sep .details{
    align-items: center;
    justify-content: center;
    display: flex;
    height: 100%;
}

.button {
    width: 200px;
    padding: 10px 15px;
    background-color: #eee;
    align-items: center;
    justify-content: center;
    display: flex;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all ease-in-out 0.1s;
    box-shadow: 0 7px 15px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(246, 246, 246, 0.5);
}

.button:hover {
    background: #000000;
    transform: scale(1.025);
    color: #fff;
}

.button:active {
    background: #313131;
    transform: scale(0.95);
    color: #fff;
}