body {
    margin: 0;
    align-content: center;
    font-family: 'Pixel', monospace;
    font-size: 24px;
    color: #2d1b5f;
    text-shadow: 1px 1px 0 #b6b6b6;
    overflow-x: hidden;
}
.profile main {
    padding: 1em;
    box-sizing: content-box;
    min-height: 100vh;
    margin: auto;
    margin-top: 0;
}
@media screen and (max-width: 480px) {
    body {
        font-size: 18px;
    }
}

/*      Анимации        */

@keyframes moveCloud {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(100vw);
    }
}

@keyframes twinkle {
    0% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.3;
    }
}

@keyframes swing {
    0% {
        transform: translateX(-50%) rotate(-3deg) translateY(0);
    }
    100% {
        transform: translateX(-50%) rotate(3deg) translateY(5px);
    }
}

/*      Фон     */

.banner {
    background: linear-gradient(to bottom, #04062e, #311b5f);
    position: fixed;
    overflow-x: hidden;
    top: 0;
    left: -1%;
    right: -2%;
    bottom: -10%;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 1.5s infinite;
}

.cloud {
    position: absolute;
    filter: brightness(1.1);
}

.pink-cloud {
    position: absolute;
    filter: brightness(1.1);
}

.pixel {
    width: 8px;
    height: 8px;
    position: absolute;
}


/*      Заголовок       */

.swing-cloud {
    position: relative;
    left: 50%;
    top: 5%;
    z-index: 12;
    animation: swing 4s ease-in-out infinite alternate;
    font-size: 30px;
}

.swing-cloud {
    position: relative;
    left: 50%;
    top: 5%;
    z-index: 12;
    animation: swing 4s ease-in-out infinite alternate;
    font-size: 30px;
}

/*@media screen and (max-width: 480px) {*/
/*    .swing-cloud {*/
/*        font-size: 16px;*/
/*    }*/
/*}*/
@media screen and (max-width: 768px) {
    .swing-cloud {
        font-size: 24px;
    }
}

.cloud-text {
    position: absolute;
    transform: translate(50%, 100%);

    white-space: nowrap;
}

#title-cloud {
    margin: auto;
    height: 100%;
    width: 10%;
}

/*      Меню       */

#menu_container {
    font-family: 'Pixel', monospace;
    color: #fff;
    text-decoration: none;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin: auto;
    min-height: 40vh;
}

main {
    box-sizing: content-box;
    border-radius: 15px;
    position: relative;
    width: 90%;
    min-height: 100vh;
   /* background: #1b1437;*/
    margin: auto;
}

/*@media screen and (max-width: 768px) {*/
/*    #menu_container {*/
/*        grid-template-columns: repeat(1, 1fr);*/
/*        gap: 30px;*/
/*    }*/
/*}*/
@media screen and (max-width: 1200px) {
    #menu_container {
        margin-top: 100px;
        width: 70%;
        grid-template-columns: repeat(1, 1fr);
        gap: 30px;
    }
}

a {
    font-family: 'Pixel', monospace;
    text-decoration: none;
}

.menu_icon {
    width: 30%;
    align-content: center;
}
.menu_icon img {
    width: 4em;
}
.menu_item {
    height: 80%;
    margin: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 1);
    display: grid;
    border-radius: 10px;
    grid-template-columns: 20% 60%;
    justify-content: space-around;
}

.menu_item:hover {
    background: #1b1437;
}

.menu_text {
    color: #fff;
    margin-left: 10px;
}

.menu_item_desc {
    align-items: center;
    font-size: 0.7em;
}

/* Основной стиль */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #010030;
    padding: 16px 0; /* было 8px */
    z-index: 1000;
    box-shadow: 6px 3px 4px rgba(0, 0, 0, 0.4);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.logo img {
    height: 64px; /* было 32px */
    image-rendering: pixelated;
}

.logo {
    color: #2d1b5f;
}

.nav {
    display: flex;
    gap: 24px;
    font-family: 'Press Start 2P', monospace;
    font-size: 18px;
}
.head_menu_img {
    display: none;
}

.nav a, .profile_cat, .profile_cat_mobile {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav a:hover, .profile_cat, .profile_cat_mobile {
    color: #ffd1dc;
}

.profile_cat {
    position: relative;
    margin-left: -20%;
    width: 64px;
    height: 64px;
}

/* Бургер */
.burger, .profile_cat_mobile {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.profile_cat_mobile {
    margin-right: -55%;
    width: 100px;
    height: 100px;
}

.burger svg {
    width: 36px; /* было 28 */
    height: 26px; /* было 20 */
}

/* Адаптив */
@media (max-width: 1120px) {
    .nav {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 100vw;
        background-color: #140030;
        flex-direction: column;
        align-items: center;
        padding: 60px 0;
        overflow-y: auto;
        
        /* анимация скрытия */
        transform: translateX(-100%);
        opacity: 0;
        transition: transform 0.3s ease-out, opacity 0.3s ease-out;
        pointer-events: none;
        z-index: 1000;
    }
    
    .nav.active {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .burger, .profile_cat_mobile {
        display: block;
    }
    .profile_cat {
        display: none;
    }
}


::-webkit-scrollbar {
    display: none;
}

.site-footer {
    background-color: #010030;
    color: #fff;
    font-family: 'Press Start 2P', monospace;
    text-align: center;
    padding: 0;
    margin-top: 64px;
    z-index: 26;
    position: relative;
    width: 100%;
    bottom: 0;
}

.footer-city svg {
    width: 100%;
    height: auto;
    display: block;
    image-rendering: pixelated;
}

.footer-info {
    padding: 16px 0;
    font-size: 0.8em;
    line-height: 1.6;
    opacity: 0.7;
}

.window {
    animation: flicker 2s infinite;
    transform-origin: center;
}

@keyframes flicker {
    0%, 100% {
        opacity: 1;
    }
    30% {
        opacity: 0.6;
    }
    60% {
        opacity: 0.3;
    }
    80% {
        opacity: 0.8;
    }
}

/* Немного разнообразия: случайные задержки */
.window:nth-child(1) {
    animation-delay: 0s;
}

.window:nth-child(2) {
    animation-delay: 0.5s;
}

.window:nth-child(3) {
    animation-delay: 1s;
}

.window:nth-child(4) {
    animation-delay: 1.5s;
}

.window:nth-child(5) {
    animation-delay: 0.7s;
}

.window:nth-child(6) {
    animation-delay: 1.2s;
}

.page-wrapper {
    gap: 20px;
    height: 100%;
    margin-top: 8em;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 25;
    position: relative;
    width: 100%;
}

#story_container {
    padding: 24px 40px 24px 100px;
    color: #fff;
    text-shadow: none;
    font-size: 0.8em;
    text-align: justify;
}

.story-footer, .story-title {
    text-align: center;
}

.story-title {
    font-size: 2em;
}

#stories_container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.story_card {
    gap: 3em;
    padding: 2em;
    width: 80%;
    border: 4px #fff solid;
    border-radius: 15px;
    margin: 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.item_text {
    width: 100%;
}

.icon {
    display: flex;
    width: 15%;
    justify-self: center;
    align-items: center;
    justify-content: center;
}

.icon img {
    width: 100%;
}

.story_card a {
    font-size: 2em;
    color: #fff;
    text-decoration: none;
    text-shadow: none;
}

.item_text {
    width: 80%;
}

.item_title {
    font-size: 0.8em;
}

.story_desc {
    font-size: 0.4em;
}

#gallery_container {
    margin-bottom: 50px;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 30%);
    gap: 30px;
    justify-content: center;
}

#gallery_container > form:last-child {
    grid-column: 1 / -1;
    aspect-ratio: 20 / 1;
    padding: 24px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
}
#gallery_container > :first-child {
    grid-column: 1 / -1;
    text-align: center;
    padding: 24px;
}
@media screen and (max-width: 1200px) {
    #gallery_container {
        grid-template-columns: repeat(2, 45%);
        gap: 30px;
        justify-content: center;
    }

    #gallery_container > form:last-child {
        gap: 5%;
        grid-column: 1 / -1;
        aspect-ratio: 20 / 1;
        padding: 1em;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-around;
    }
}
.title-label {
    color: #fff;
}

.add_file-input {
    border: 1px #fff solid;
    background-color: inherit;
    color: #fff;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    cursor: pointer;
}

.add_picture_button {
    background-color: inherit;
    color: #fff;
    border-radius: 15px;
    border: 1px #fff solid;
    font-size: 0.8em;
    font-family: inherit;
    padding: 5px 10px;
}

.add_story_button {
    background-color: inherit;
    color: #fff;
    border-radius: 15px;
    border: 1px #fff solid;
    font-size: 0.8em;
    font-family: inherit;
    padding: 5px 10px;
    margin-bottom: 20px;
    margin: 1em;
}

.song_input {
    background-color: #1b1437;
    color: #fff;
    border-radius: 7px;
    border: 1px #fff solid;
    font-size: 0.8em;
    font-family: inherit;
    padding: 5px 10px;
}

.add-song {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px;
}

.add_song_button {
    background-color: inherit;
    color: #fff;
    border-radius: 15px;
    border: 1px #fff solid;
    font-size: 0.8em;
    font-family: inherit;
    padding: 5px 10px;
    margin: 1em;
}

.gallery-item {
    background-size: cover;
    aspect-ratio: 1/1;
    border-left: rgba(255, 255, 255, 0.5) 3px solid;
    border-top: rgba(255, 255, 255, 0.5) 3px solid;
    box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.5);
    border-radius: 15px;
}


.change-story {
    height: 64px;
    width: 70px;
    right: 0;
    background: url(/img/change.svg) no-repeat center center;
    background-size: cover;
    background-position-x: 0;
    background-position-y: center;
}

/* 
.change-story svg {
    width: 30%;
}


@media screen and (max-width: 1000px) {
    .change-story {
        width: 2em;
        height: 2em;
    }
}

@media screen and (max-width: 880px) {
    .change-story {
        width: 12%;
        height: 7%;
    }
}*/

@media screen and (max-width: 480px) {
    .icon {
        margin-left: auto;
        margin-right: auto;
        display: flex;
        width: 30%;
        justify-self: center;
        align-items: center;
        justify-content: center;
    }
}

@media screen and (min-width: 480px) and (max-width: 800px) {
    .icon {
        margin-left: auto;
        margin-right: auto;
        display: flex;
        width: 20%;
        justify-self: center;
        align-items: center;
        justify-content: center;
    }
}

.now_playing {
    color: #fff;
    width: 100%;
    display: flex;
    flex-direction: column;
    background: #0a001a;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 999;
}

.np-label {
    font-size: 0.8em;
    margin: 7px;
    margin-bottom: 0;
    margin-left: 1.5%;
}

@media (max-width: 800px) {
    /* порог выбери сам */
    .np-label .track-text {
        display: none;
    }
}

h1 {
    color: aliceblue;
    font-size: 2em;
}


.player {
    display: flex;
    flex-direction: column;
    align-content: center;
    align-items: center;
}

#playlist_container {
    width: 100%;
}

.playlist-list > li {
    height: 2em;
    overflow: hidden;
    width: 84%;
    text-shadow: none;
    padding: 0.5em;
    color: #fff;
    border: #f0f8ff 3px solid;
    border-radius: 7px;
    display: block;
    margin: 1% auto;
    background: url(/img/play.svg) no-repeat;
    background-size: 4%;
    padding-left: 6%;
    line-height: 2;
    background-position-x: 1%;
    background-position-y: center;
    padding-right: 5%;
    cursor: pointer;
}

.playlist-list {
    margin-block-start: 0;
    margin-block-end: 0;
    padding-inline-start: 0;
}

.playlist-list > li.active {
    background: url(/img/pause.svg) no-repeat;
    background-size: 4%;
    background-position-x: 1%;
    background-position-y: center;
}

@media screen and (max-width: 800px) {
    .playlist-list > li, .playlist-list > li.active {
        width: 80%;
        background-size: 10%;
        padding-left: 12%;
    }
}

.audio-item {
    height: 2em;
    overflow: hidden;
    width: 84%;
    text-shadow: none;
    padding: 0.5em;
    color: #fff;
    border: #f0f8ff 3px solid;
    border-radius: 7px;
    display: block;
    margin: 1% auto;
    background: url(/img/play.svg) no-repeat;
    background-size: 4%;
    padding-left: 6%;
    line-height: 2;
    background-position-x: 1%;
    background-position-y: center;
    padding-right: 5%;
    cursor: pointer;
}
.audio-item.active {
    background: url(/img/pause.svg) no-repeat;
    background-size: 4%;
    background-position-x: 1%;
    background-position-y: center;
}
@media screen and (max-width: 800px) {
    .audio-item, .audio-item.active {
        width: 80%;
        background-size: 10%;
        padding-left: 12%;
    }
}
.song-message {
    display: none;
    border-radius: 7px;
    padding: 10px;
    border: aliceblue 3px solid;
    margin: 10px;
}

.song-message.active {
    display: block;
}

.add_song_form {
    gap: 10px;
    display: flex;
    margin: 20px;
    flex-direction: column;
    padding: 24px;
    border-left: rgba(255, 255, 255, 0.5) 3px solid;
    border-top: rgba(255, 255, 255, 0.5) 3px solid;
    box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.5);
    border-radius: 15px
}

.login-box {
    top: 30vh;
    width: 50%;
    position: relative;
    gap: 10px;
    display: flex;
    margin: auto;
    flex-direction: column;
    padding: 24px;
    border-left: rgba(255, 255, 255, 0.5) 3px solid;
    border-top: rgba(255, 255, 255, 0.5) 3px solid;
    box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    z-index: 10;
    color: #fff;
    align-items: center;
}

#login-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.login_input {
    background-color: #1b1437;
    color: #fff;
    border-radius: 7px;
    border: 1px #fff solid;
    font-size: 0.8em;
    font-family: inherit;
    padding: 5px 10px;
}
.form_input {
    background-color: #1b1437;
    color: #fff;
    border-radius: 7px;
    border: 1px #fff solid;
    font-size: 0.8em;
    font-family: inherit;
    padding: 5px 10px;
}
.login_button {
    background-color: inherit;
    color: #fff;
    border-radius: 15px;
    border: 1px #fff solid;
    font-size: 0.8em;
    font-family: inherit;
    padding: 5px 20px;
}

.np-prev, .np-next, .np-playpause {
    cursor: pointer;
    border: none;
    width: 40px;
    height: 40px;
    background: url(/img/next.svg) no-repeat;
    background-size: 100%;
    background-position-x: 0;
    background-position-y: center;
    margin: 5px;
    margin-top: 0;
}

.np-playpause {
    background: url(/img/play.svg) no-repeat;
    background-size: 100%;
    background-position-x: 0;
    background-position-y: center;
}

.np-playpause.active {
    background: url(/img/pause.svg) no-repeat;
    background-size: 100%;
    background-position-x: 0;
    background-position-y: center;
}

.np-prev {
    transform: rotate(180deg);
}

.controls {
    align-self: center;
    margin-bottom: 2px;
}

.progress-container {
    margin-right: 1%;
    margin-left: 1%;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

ul {
    margin-block-start: 0;
    margin-block-end: 0;
    padding-inline-start: 0;
}

.media_container {
    margin-top: 50px;
    margin-bottom: 50px;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 30%);
    gap: 30px;
    justify-content: center;
}

.media_container > form:last-child {
    grid-column: 1 / -1;
    aspect-ratio: 20 / 1;
    padding: 24px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
}
@media screen and (max-width: 1200px) {
    .media_container {
        grid-template-columns: repeat(2, 45%);
        gap: 30px;
        justify-content: center;
    }

    .media_container > form:last-child {
        gap: 5%;
        grid-column: 1 / -1;
        aspect-ratio: 20 / 1;
        padding: 1em;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-around;
    }
}
.gallery-title {
    grid-column: 1 / -1;
    text-align: center;
    padding: 24px;
    color: aliceblue;
}
.tab {
    border-radius: 7px 7px 0 0;
    font-family: inherit;
    font-size: 1em;
    color: #fff;
    border: none;
    background: inherit;
    width: 100%;
    padding: 10px;
}
.tab:hover {
    background: #482989;
}
.tab.active {
    border-bottom: aliceblue 3px solid;
    background: #311b5f;
}
.tabs {
    border-bottom: 1px solid #fff;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
}

.modal {
  display: none; /* скрыто по умолчанию */
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 130px;
  width: 100%;
  height: 90vh;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.7);
  justify-content: center;
}

.modal-content {
  margin-top: 20px;
  max-width: 70vw;
  max-height: 70vh;
  border-radius: 4px;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.modal-close {
  position: fixed;
  top: 140px;
  right: 30px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}

.video-thumbnail {
    margin: auto;
    max-width: 100%;
    max-height: 100%;
    border-radius: 15px 15px 0 0;
}
.modal-media {
  display: none;
}
.media-audio, .media-text, .media-links {
    display: flex;
    flex-direction: column;
    width: 100%;
}
.video-title {
    width: 100%;
    background: #00000052;
    padding: 5px;
    color: aliceblue;
    border-radius: 0 0 15px 15px;
}
.video-item {
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}
.text-item, .link-item {
    margin: auto;
    aspect-ratio: auto;
    width: 95%;
    color: aliceblue;
    text-shadow: none;
    text-align: justify;
    font-size: 0.8em;
}
.media-text, .media-links {
    align-items: center;
}
.text-block, .link-block  {
    margin: 10px;
}
.link-item > a {
    color: aliceblue;
}
.link-block {
    line-height: 1.3em;
    height: 1.3em;
    overflow: hidden;
}
.modal.mobile-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.modal.mobile-fullscreen .modal-content {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    max-width: 100vw;
    max-height: 100vh;
}

.modal.mobile-fullscreen #modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 5rem;
    color: white;
    z-index: 10000;
    cursor: pointer;
}
@media screen and (max-width: 400px) {
    .tabs {
        font-size: 0.8em;
    }
}
.modal-content.slide-left  { animation: slideLeft 0.3s; }
.modal-content.slide-right { animation: slideRight 0.3s; }
.modal-content.slide-up    { animation: slideUp 0.3s; }
.modal-content.slide-down  { animation: slideDown 0.3s; }

@keyframes slideLeft  { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideRight { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideUp    { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideDown  { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-nav.prev, .modal-nav.next {
    position: fixed;
    top: 50%;
    border: none;
    height: 3em;
    width: 5em;
    background: url(/img/arrow-left.svg) no-repeat;
    background-size: 100%;
    background-position-x: 0;
    background-position-y: center;
}
.modal-nav.prev {
    left: 5%;
}
.modal-nav.next {
    right: 5%;
    transform: rotate(180deg);
}

@media screen and (max-width: 1000px) {
    .modal-nav.prev, .modal-nav.next {
        display: none;
    }
}
.time-display {
    min-width: 80px;
    text-align: right;
    font-family: monospace;
    font-size: 0.7em;
    color: #ccc;
}
.progress-container {
    display: flex; 
    align-items: center; 
    gap: 10px; 
    margin-top: 5px;
}

input:not(#story_container input)::placeholder,
textarea:not(#story_container textarea)::placeholder {
    color: #f0f8ffcc;
}

.file-preview-text {
    text-shadow: none;
    color: #777cd0;
}

#messages_container {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.messages-list {
    display: flex;
    text-shadow: none;
    color: #fff;
    width: 90%;
    flex-direction: column;
    gap: 0.5em;
}

.mes {
    display: flex;
    padding: 1em;
    border-radius: 7px;
    border: 3px solid aliceblue;
    flex-direction: column;
}

.mes p {
    margin: 0.2em;
}

.author {
    text-align: right;
}

.author p {
    color: #f0f8ffc2;
    font-size: 0.8em;
    margin: 0;
}

#add_form {
    width: 80%;
    font-size: 1em;
    margin: 1em;
}
.form_input {
    font-size: 1em;
}

.old_photo {
    display: none;
}

.userinfo {
    gap: 1.1em;
    display: grid;
    grid-template-rows: 0.2fr 2fr 0.2fr;
    grid-template-areas:
        "username username change"
        "profilepic desc desc"
        "login desc desc"
        "notifs notifs notifs"
        "friends friends friends"
        "calendar calendar calendar";
    grid-template-columns: 0.7fr 1fr 1fr;
    justify-content: center;
}

/* Только в режиме редактирования */
.userinfo.edit-mode {
    grid-template-columns: 2fr 0.5fr;
}

.user_desc {
    grid-area: desc;
    display: flex;
    color: #fff;
    text-shadow: none;
    align-items: center;
}

#description {
    height: 86%;
    width: 100%;
    padding: 1em;
    word-break: break-word;
    border: 3px solid aliceblue;
    border-radius: 7px;
    margin: 0;
}

#login {
    grid-area: login;
    color: #fff;
    display: flex;
    justify-content: center;
}

#profile_photos_container {
    grid-area: profilepic;
}

.clickable-profile-photo {
    object-position: center top;
    object-fit: cover;
    width: 100%;
    height: 100%;
}
#change {
    float: right;
    grid-area: change;
    width: 64px;
    height: 64px;
    background: url(/img/change.svg) no-repeat;
    background-size: 100%;
    background-position-x: 0;
    background-position-y: center;
}

#username {
    grid-area: username;
    margin: 0.1em;
    color: #fff;
}

h2 {
    color: #fff;
}

.friends-container {
    grid-area: friends;
}

.friends-list {
    display: grid;
    grid-template-columns: repeat(3, 30%);
}

.friend-group-title {
    margin: 0.5em;
    color: #fff;
    text-align: center;
    text-shadow: none;
    font-size: 1.2em;    
}

.friend-item {
    text-decoration: none;
    color: #fff;
    padding: 1em;
    border-radius: 7px;
    border: aliceblue 3px solid;
    gap: 1em;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.friend-photo {
    width: 90%;
}

.username-row {
    grid-area: username;
    display: contents; /* элементы продолжают участвовать в grid */
}

#desc-input {
    height: 8em;
}

#profile_edit_form {
    margin: 0;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    width: 100%;
    padding-right: 35px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eye-icon {
    width: 20px;
    height: 20px;
}

.toggle-password .eye-hide {
    display: none;
}

.toggle-password.active .eye-show {
    display: none;
}

.toggle-password.active .eye-hide {
    display: inline;
}

.modal-delete-btn {
    border-radius: 7px;
    padding: 0.2em 0.5em;
    font-size: 1em;
    bottom: 10%;
    position: absolute;
    color: #fff;
    background: #d8444440;
}

.calendar-section {
    grid-area: calendar;
    width: 100%;
}

#calendar-wrapper {
    gap: 3em;
    display: flex;
    color: #fff;
    text-shadow: none;
    flex-direction: row;
    justify-content: center;
}

.calendar {
    gap: 0.5em;
    display: grid;
    grid-template-columns: repeat(7, 2em);
    grid-template-areas:
        "m m m m m m m"
        "d d d d d d d"
        "d d d d d d d"
        "d d d d d d d"
        "d d d d d d d"
        "d d d d d d d";
}

.calendar_title {
    display: flex;
    grid-area: m;
    justify-content: center;
}
.dof, .calendar_day, .calendar_no_day {
    display: flex;
    height: 2em;
    width: 2em;
    justify-content: center;
    align-items: center;
}
.dof {
    border-radius: 7px;
    border: 3px solid #140030;
    color: #140030;
    background-color: #f0f8ffc4;
}

.calendar_day  {
    border-radius: 7px;
    border: 3px solid #fff;
    cursor: pointer;
}

.calendar_day:not(.disabled):not(.busy):not(.bday):not(.other):hover {
    background-color: #140030;
}

.today {
    color: #140030;
    background: #f0f8ff;
}
.today:not(.disabled):not(.busy):not(.bday):not(.other):hover {
    color: #fff;
}

.popup {
  color: #fff;
  text-shadow: none;
  background: #140030;;
  padding: 10px;
  border-left: rgba(255, 255, 255, 0.5) 3px solid;
  border-top: rgba(255, 255, 255, 0.5) 3px solid;
  box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.5);
  border-radius: 15px;
  z-index: 1000;
}

.hidden {
  display: none;
}


#day-form, #busy_day-form {
    gap: 0.5em;
    display: flex;
    flex-direction: column;
    text-shadow: none;
}

.form_calendar_title {
    text-align: center;
    margin: 0.5em;
    color: aliceblue;
}

.color_input {
    border: none;
    background-color: inherit;
    width: 2.7em;
    height: 3em;
    padding: 0;
}

.notifications_count {
    padding: 0.15em 0.5em;
    aspect-ratio: 1 / 1;
    border-radius: 100%;
    right: 5%;
    top: 10%;
    position: absolute;
    font-size: 0.5em;
    color: #ffffff;
    background: red;
}

#notifs {
    display: none;
    background: #00000059;
    border-radius: 7px;
    padding: 1em;
    border: 3px aliceblue solid;
    color: #fff;
    grid-area: notifs;
    text-shadow: none;
}
.notification-item {
    padding: 0.5em;
    border-bottom: 1px aliceblue solid;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.notification-item:last-child {
    border: none;
}

.notification-text {
    margin: 0;
}
.notification-buttons {
    float: right;
}

.notification-btn {
    margin-bottom: 0;
}
.disabled {
    opacity: 0.7;
    cursor: default;
}

.popup .title-label {
    gap: 1em;
    display: flex;
    color: #fff;
    flex-direction: row;
    justify-content: space-between;
}

.calendar_day.busy {
    opacity: 0.9;
}

.calendar_day.bday {
    opacity: 0.9;
    background-color: #ffff33;
}
.calendar_day.other {
    opacity: 0.9;
}

.loader {
  font-size: 0.8em;
  color: #fff;
  width: fit-content;
  font-weight: bold;
  font-family: monospace;
  font-size: 30px;
  clip-path: inset(0 100% 0 0);
  animation: l5 0.8s steps(11) infinite;
}

.loader:before {
  content: "Загрузка...";
}

@keyframes l5 {
  to {
    clip-path: inset(0 -1ch 0 0);
  }
}

.popup-style {
    font-size: 0.8em;
    color: #fff;
    text-shadow: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 30vw;
    background: #00000091;
    border: 1px solid #ccc;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    padding: 15px;
    z-index: 10000;
    animation: fadeIn 0.4s ease-in-out;
}

.notification-item.popup-style {
    transition: bottom 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media screen and (max-width: 1000px) {
    .notifications_count {
        right: 17%;
        top: 27%;
    }
    .userinfo {
        gap: 1em;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .username-row {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.5em;
        }
    
    #username {
        margin: 0;
        /*font-size: 1.5em;*/
    }
    #description {
        font-size: 1.5em;
    }
    .toggle-password {
        right: 5%;
    }
    .eye-icon {
        width: 30px;
        height: 30px;
    }
    #calendar-wrapper {
        font-size: 2em;
        flex-direction: column;
        align-items: center;
    }
    #day-form, #busy_day-form {
        gap: 1em;
    }
    
    #day-form .form_input {
        font-size: 1em;
    }
    .form_calendar_title {
        font-size: 2.5em;
    }
    .funny-grid {
        margin-top: 5%;
    }
    .time-display {
        font-size: 1em;
    }
    .playlist-list > li, .audio-item {
        font-size: 2em;
        height: 2.5em;
        overflow: hidden;
        width: 68%;
        text-shadow: none;
        padding: 0.5em;
        color: #fff;
        border: #f0f8ff 3px solid;
        border-radius: 7px;
        display: block;
        margin: 1% auto;
        background: url(/img/play.svg) no-repeat;
        background-size: 10%;
        padding-left: 15%;
        line-height: 2.5;
        background-position-x: 2%;
        background-position-y: center;
        padding-right: 15%;
        cursor: pointer;
    }
    .playlist-list > li.active, .audio-item.active {
        background: url(/img/pause.svg) no-repeat;
        background-size: 10%;
        background-position-x: 2%;
        background-position-y: center;
    }
    .progress-container {
        margin-bottom: 1em;
        margin-top: 1em;
    }
    .np-label {
        font-size: 2em;
        height: 1.2em;

    }
    .np-playpause, .np-next, .np-prev {
        width: 100px;
        height: 100px;
    }
    .controls {
        margin: 10px auto 10px auto;
    }
    .add_song_button, .add_story_button {
        border: 3px #fff solid;
        font-size: 2em;
        padding: 10px 15px;
    }
    h1 {
        font-size: 4em;
    }
    .footer-info {
        font-size: 1.3em;
        line-height: 0.8;
    }
    .logo > p {
        display: none;
    }
    .logo img {
        height: 150px;
    }
    .burger svg {
        width: 70px;
        height: 50px;
    }
    .nav {
        top: 180px;
    }
    .nav a {
        width: 100%;
        font-size: 3em;
        border-bottom: aliceblue solid 3px;
    }
    .nav.active {
        height: 100vh;
    }
    .head_menu_item {
        display: flex; 
        flex-direction: row;
        justify-content: space-between;
        padding: 0.5em;
    }
    .head_menu_item img {
        height: 3em;
        width: auto;
    }
    .head_menu_img {
        width: 30%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .menu_icon {
        width: 100%;
        align-content: center;
    }
    .menu_icon img {
        width: 100%;
    }
    .menu_item_desc {
        font-size: 1em;
    }
    .menu_item_title {
        font-size: 1.2em;
    }
    .add_song_form {
        width: 90%;
        gap: 1em;
    }
    .song_input {
        letter-spacing: 1px;
        padding: 0.5em;
        font-size: 1.5em;
    }
    .add_file-input {
        font-size: 1.2em;
    }
    .file-preview-text {
        font-size: 1.5em;
    }
    .add_picture_button  {
        font-size: 2em;
    }
    .form_input {
        letter-spacing: 1px;
        padding: 0.5em;
        font-size: 1.5em;
    }
    .title-label {
        font-size: 2em;
    }
    .text-item, .link-item {
        font-size: 1.5em;
    }
    .text-block, .link-block {
        padding: 0.5em;
    }
    .link-block {
        height: 1em;
    }
    .login-box {
        width: 80vw;
    }
    #login-form {
        gap: 0.5em;
        font-size: 3em;
        width: 95%;
    }
    .login-box h2 {
        font-size: 4em;
    }
    .story-title {
        font-size: 3em;
    }
    #story_container {
        font-size: 1.5em;
    }
    .story-title_changemode, .story-file_changemode {
        width: 98.5%;
    }
    
    #add_form .add_song_button {
        font-size: 1em;
    }
}
    
    
    
    