:root {
    --bg: linear-gradient(135deg, #333435 0%, #233435 100%);/*#333435;*/
    --top: #232526b0;
    --trmetal: #232526;
    --pstrmetal: #5c5f61;
    --bgimg: none;
    --befrb: transparent;
    --opac: #35383a;
    --nonmetal: #34464f;
    --metalloid: #3a3d3f;
    --langlist: #232526b0;
}

.dark-theme {
    --bg: linear-gradient(135deg, #110f0f 0%, #171515 100%);/*#110f0f;*/
    --top: #000000ad;
    --trmetal: #1a1b1c;
    --pstrmetal: #222425;
    --bgimg: none;
    --befrb: transparent;
    --opac: #35383a;
    --nonmetal: #282e4b;
    --metalloid: #2a2e31;
    --langlist: #191818b0;
}

.bg-theme {
    --bg: linear-gradient(135deg, #232526 0%, #414345 100%);
    --top: #00000079;
    --trmetal: #1a1b1c;
    --pstrmetal: #222425;
    --bgimg: url('./src/brb.jpg');
    --befrb: #35383a9b;
    --opac: #35383a86;
    --nonmetal: #34464f;
    --metalloid: #3a3d3f;
    --langlist: #232526b0;
}

body {
    background: var(--bgimg) no-repeat center center/cover, var(--bg);
    background-attachment: fixed;
    color: #e0e0e0;
    font-family: sans-serif;
    margin: 0;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-color: var(--befrb);
}

.top {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: space-between;
    top: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background-color: var(--top);
    z-index: 2;
    padding: 0 20px;
}

#lang-btn {
    background: #1f202081;
    color: #ece0e0;
    border: none;
    border-radius: 4px;
    padding: 8px 18px;
    font-size: 1.1em;
    cursor: pointer;
    box-shadow: 0 2px 8px #0004;
    transition: background 0.2s, color 0.2s;
    margin-right: 15px;
}

#lang-btn:hover {
    background: #35383a;
}

.lang-list {
    display: none;
    flex-direction: column;
    position: absolute;
    right: 0;
    top: 110%;
    background: var(--langlist);/*#232526;*/
    border-radius: 10px;
    box-shadow: 0 4px 16px #000a;
    padding: 8px 0;
    z-index: 2;
    min-width: 160px;
    animation: fadeIn 0.2s;
}

.lang-list.show {
    display: flex;
}

.lang-list button {
    background: none;
    border: none;
    color: #dfd094;
    font-size: 1.1em;
    padding: 10px 20px;
    text-align: left;
    cursor: pointer;
    width: 100%;
    transition: background 0.15s, color 0.15s;
}

.lang-list button:hover {
    background: #35383a;
    color: #fff;
}

.flag {
    font-size: 1.4em;
    margin-right: 10px;
}

.pre-table {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 30px;
    overflow-x: auto;
}
.widthalert{
    display: none;
}
@media (max-width: 800px) {
    .widthalert {
        z-index: 3;
        font-size: 25px;
        display: flex !important;
        position: fixed;
        background:  linear-gradient(135deg, #2b6296 0%, #16168b 100%);
        width: 100%; height: 100%;
        justify-content: center;
        align-items: center;
    }
    body > *:not(.widthalert) { /*ts trick :pray:*/
        display: none !important;
    }
}

@media (max-width: 1200px) {
    .table {
        min-width: unset !important;
        width: 100vw !important;
        max-width: 100vw !important;
        grid-template-columns: repeat(19, 1fr) !important;
    }
    .cell {
        width: calc(100vw / 21) !important;
        height: calc(100vw / 21) !important;
        min-width: unset !important;
        max-width: unset !important;
    }
    .cell .n,
    .cell .symbol,
    .cell .elementname {
        font-size: calc(100vw / 110) !important;
    }
}

.table {
    display: grid;
    /*grid-template-columns: repeat(1, 1fr);*/
    gap: 6px;
    margin: 65px auto 50px auto;
    min-width: 600px;
    max-width: 1300px;
    overflow: hidden;
    user-select: none;
}

.cell {
    position: relative;
    background: #232526;
    box-shadow: 0 2px 12px #0004;
    text-align: center;
    cursor: pointer;
    transition: .15s;
    user-select: none;
    opacity: 0;
    animation: popIn .6s forwards;
    width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cell>* {
    pointer-events: none;
}

.cell:hover,
.cell:active {
    background: var(--opac);
    color: #fff;
    box-shadow: 0 6px 24px #222a;
    z-index: 2;
}
.cell.card:hover {
    transform: scale(1.1);
}

.cell:active .s,
.cell:hover .s {
    color: #fff;
}
.group {
    height: 15px;
    font-family: 'Inter', 'Roboto', 'Segoe UI', Arial, Helvetica, sans-serif;/*sybau google fonts*/
    width: 100%;
    font-size: 13px;
    background-color: #45414140;
    text-align: center;
    display: flex;
    align-content: center;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}
.period {
    height: 100%;
    font-family: 'Inter', 'Roboto', 'Segoe UI', Arial, Helvetica, sans-serif;
    width: 15px;
    font-size: 14px;
    background-color: #45414140;
    text-align: center;
    display: flex;
    align-content: center;
    align-items: end;
    justify-content: center;
    flex-wrap: wrap;
}
.n {
    font-size: .7rem;
    color: #888a8c;
}

.symbol {
    font-size: 1.1rem;
    font-weight: bold;
    color: #b0bec5;
}

.elementname {
    font-size: .6rem;
    color: #a0a0a0;
}

.hg {
    background: #454141bc !important;
    transition: background 0.2s,;
}

.nonmetal,
.non-metallo,
.nemetal {
    background: var(--nonmetal);
}

.metal,
.metallo {
    background: #44474a;
}

.metalloid,
.metalloide,
.metaloid {
    background: var(--metalloid);
}

.noble-gas,
.gas-nobile,
.gaz-nobil {
    background: #23203a;
    border: 1px solid #b388ff;
}

.alkali-metal,
.metallo-alcalino,
.metal-alcalin {
    background: #37372f;
    border: 1px solid #ffe066;
}

.alkaline-earth-metal,
.metal-alcalino-pamantos {
    background: #232526;
    border: 1px solid #fff3b0;
}

.transition-metal,
.metallo-di-transizione,
.metal-de-tranzitie {
    background: var(--trmetal);
}

.halogen,
.alogeno {
    background: #232526;
    border: 1px solid #00e676;
}

.lanthanide,
.lantanide,
.lantanid {
    background: #303d43;
}

.actinide,
.attinide,
.actinid {
    background: #41382f;
}

.post-transition-metal,
.metallo-post-transizione,
.metal-post-tranzitie {
    background: var(--pstrmetal);
}

.unknown,
.sconosciuto,
.necunoscut {
    background: #1a1e22;
}

.element-container {
    display: flex;
    justify-content: center;
    width: 50%;
    background-color: #25292baf;
    height: 300px;
    border-radius: 10px;
    flex-direction: column;
}

.radioactive {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 1.2em;
    color: #ffeb3b;
    opacity: 0.65;
    pointer-events: none;
    filter: drop-shadow(0 0 4px #ffeb3b88);
    z-index: 3;
}

@keyframes popIn {
    from {
        opacity: 0;
        /*transform: scale(.7);*/
    }

    to {
        opacity: 1;
        /*transform: scale(1);*/
    }
}

.element-card {
    position: absolute;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px #000a;
    padding: 24px 32px;
    z-index: 1000;
    width: 220px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.close-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5em;
    cursor: pointer;
}

.card-symbol {
    font-size: 2.5em;
    font-weight: bold;
    margin-left: 10px;
    margin-bottom: 8px;
}

.card-name {
    font-size: 1.2em;
    margin-bottom: 12px;
}

.card-content div {
    font-size: 1em;
    margin-bottom: 4px;
}
#titlebar {
    font-size: 1.4em;
    font-family:Arial, Helvetica, sans-serif;
    margin-left: 7px;
}
.themeicon {
    cursor: pointer;
    max-height: 60%;
    align-self: center;
    vertical-align: middle;
    margin-left: 15px;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}