.loader {
  --color-1: #fff;
  --color-2: #ff3d00;
  --size: 2px;

  width: calc(48 * var(--size));
  height: calc(48 * var(--size));
  border: calc(3 * var(--size)) dotted var(--color-1);
  border-style: solid solid dotted dotted;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  box-sizing: border-box;
  animation: rotation 2s linear infinite;
}
.loader::after {
  content: '';
  box-sizing: border-box;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  margin: auto;
  border: calc(3 * var(--size)) dotted var(--color-2);
  border-style: solid solid dotted;
  width: calc(24 * var(--size));
  height: calc(24 * var(--size));
  border-radius: 50%;
  animation: rotationBack 1s linear infinite;
  transform-origin: center center;
}

@keyframes rotation {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes rotationBack {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-360deg); }
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background-color: #000;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: #000;
    background-image: url('bg.svg');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
    color: aliceblue;
    font-family: 'Segoe UI', sans-serif;
}

#loadingSplash {
    transition: 0.5s;
    background-color: black;
    position: fixed;
    inset: 0;
    z-index: 2;
}

#loadingcont {
    transition: 0.5s;
}

header {
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    opacity: 10%;
    scale: 0.2;
    transition: 0.3s;
    translate: 0 -100%;
    background: black;
    padding: 10px;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 1;
    margin: 10px;
    border-radius: 15px;
}

#mainLabel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
        "left right"
        "down down";
    grid-template-rows: auto auto;
    align-items: stretch;
    justify-content: center;
    gap: 16px;
    width: min(780px, calc(100vw - 40px));
    position: fixed;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
    scale: 0.1;
    opacity: 0;
    transition: 0.5s;
    padding: 15px;
}

#rightBar {
    grid-area: right;
    grid-row: 1;
    align-self: stretch;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 10px;
    transition: 0.3s;
    position: relative;
    width: 100%;
    min-width: 0;
    justify-self: stretch;
    text-align: center;
    min-height: 270px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ava {
    display: block;
    width: 250px;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 50%;
}

#leftBar {
    grid-area: left;
    grid-row: 1;
    align-self: stretch;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    opacity: 0;
    min-height: 270px;
    height: 100%;
    padding: 10px;
    transition: 0.3s;
    position: relative;
    width: 100%;
}

#links {
    opacity: 0;
    transition: 0.5s;
    background-color: #ff3d00;
    min-height: 55px;
    border-radius: 10px;
    padding: 5px;
    margin: 8px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 90%;
    max-width: 100%;
}

#links > div {
    position: static !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#links img {
    display: block;
    width: 50px;
    height: auto;
}

#downBar {
    grid-area: down;
    grid-row: 2;
    grid-column: 1 / -1;
    align-self: start;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    opacity: 0;
    font-size: 20px;
    text-align: center;
    padding: 10px;
    transition: 0.3s;
    position: relative;
    width: 100%;
    margin: 0;
}

/* Мобильная компоновка: те же блоки, но в одну колонку */
@media (max-width: 700px) {
    body {
        background-attachment: scroll;
    }

    header {
        margin: 8px;
        padding: 8px 12px;
    }

    header h2 {
        font-size: clamp(14px, 4vw, 20px);
        overflow-wrap: anywhere;
    }

    #mainLabel {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "right"
            "left"
            "down";
        grid-template-rows: auto auto auto;
        #rightBar { grid-row: 1; grid-column: 1; }
        #leftBar { grid-row: 2; grid-column: 1; }
        #downBar { grid-row: 3; grid-column: 1; }
        gap: 12px;
        width: min(480px, calc(100vw - 24px));
        max-height: calc(100vh - 90px);
        max-height: calc(100dvh - 90px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 12px;
        top: 55%;
    }

    #rightBar {
        width: 100%;
        min-height: 0;
        padding: 8px;
    }

    #ava {
        width: min(210px, 58vw) !important;
    }

    #leftBar {
        width: 100%;
        min-height: 0;
        height: auto;
        padding: 14px;
    }

    #leftBar h1 {
        margin-top: 6px;
        margin-bottom: 8px;
        font-size: clamp(26px, 8vw, 36px);
    }

    #aka {
        font-size: 18px !important;
    }

    #ageOmeter,
    #leftBar > span {
        font-size: 18px !important;
    }

    #links {
        width: 90%;
        max-width: 100%;
    }

    #downBar {
        width: 100%;
        font-size: clamp(15px, 4vw, 18px);
        padding: 12px;
    }
}

/* На узких телефонах уменьшаем отступы, не меняя визуальный стиль */
@media (max-width: 360px) {
    #mainLabel {
        width: calc(100vw - 16px);
        padding: 8px;
        gap: 8px;
    }

    #leftBar {
        padding: 10px;
    }

    #downBar {
        font-size: 15px;
    }
}

/* UA-детектор дополняет адаптивность для телефонов с широким экраном */
html.mobile-device #mainLabel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "right"
        "left"
        "down";
    grid-template-rows: auto auto auto;
    width: min(480px, calc(100vw - 24px));
    max-height: calc(100vh - 90px);
    max-height: calc(100dvh - 90px);
    overflow-y: auto;
    top: 55%;
}

html.mobile-device #rightBar { grid-row: 1; grid-column: 1; }
html.mobile-device #leftBar { grid-row: 2; grid-column: 1; }
html.mobile-device #downBar { grid-row: 3; grid-column: 1; }

html.mobile-device #rightBar,
html.mobile-device #leftBar,
html.mobile-device #downBar {
    width: 100%;
}


/* Корректировка вертикального положения подписи на телефонах */
@media (max-width: 700px) {
    #aka { bottom: 13px !important; }
}
html.mobile-device #aka { bottom: 13px !important; }
