@use "./variables" as v;
@use "./main";
@use "./other/nav";
@use "./other/doodles";

@keyframes popup {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  80% {
    transform: scale(1.025);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

.app {
  width: 100%;
  height: 100%;
  overflow: visible;
}

html {
  height: 100svh;
}
body {
  overflow: visible;
}

.main {
  width: 100%;
  .sect {
    &#home {
      z-index: 1;
      position: relative;
      padding: 10px;
      width: 100%;
      min-height: 100svh;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      .card {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin-bottom: 20px;
        .icon {
          animation: slide_up_in 1s;
          img {
            max-width: 100px;
            max-height: 100px;
          }
        }
        .title {
          font-size: 1.25rem;
          text-align: center;
          animation: slide_up_in 1s;
          h1 {
            word-break: break-all;
            word-break: break-word;
            hyphens: auto;
          }
        }
        .actions {
          text-align: center;
          margin-top: 40px;
          animation: slide_down_in 1s;
          a.btn {
            display: block;
            padding: 10px 20px;
            font-weight: bold;
            text-decoration: none;
            background-color: v.$pm1;
            min-width: 200px;
            max-width: 100%;
            color: v.$px1;
            border-radius: 10px;
            overflow: hidden;
            margin-bottom: 10px;
            &:last-child {
              margin-bottom: 0;
            }
            &.joined {
              background-color: v.$pm2;
              color: v.$white;
            }
            &.hide {
              display: none;
            }
          }
        }
      }
      .author {
        position: absolute;
        bottom: 10px;
        left: 10px;
        text-align: left;
        font-family: monospace, monospace;
        font-size: 0.8rem;
        animation: slide_right_in 2s;
        p {
          a {
            color: v.$pm1;
            font-weight: bold;
          }
        }
      }
    }
    &#credits {
      background-color: v.$px25;
      padding: 20px;
      color: v.$softwhite;
      a {
        color: v.$pm1;
        text-decoration: none;
      }
      .box {
        max-width: 800px;
        margin: 0 auto;
        .chatlist {
          width: 100%;
          height: fit-content;
          overflow-x: hidden;
          padding: 20px 0;
          scrollbar-width: thin;
          .card {
            position: relative;
            width: 100%;
            margin-top: 10px;
            display: flex;
            justify-content: space-between;
            align-items: start;
            gap: 10px;
            visibility: hidden;
            .avatar {
              flex-shrink: 0;
              min-width: 40px;
              cursor: pointer;
              img {
                width: 40px;
                height: 40px;
                border-radius: 50%;
                object-fit: cover;
                -o-object-fit: cover;
                object-position: cover;
                -o-object-position: center;
              }
            }
            .field {
              margin-left: 0;
              margin-right: auto;
              width: fit-content;
              max-width: calc(100% - (40px + 40px));
              padding: 10px;
              border-radius: 10px;
              background: v.$px2;
              overflow: hidden;
              .chp {
                max-width: 425px;
                margin-bottom: 3px;
                &:last-child {
                  margin-bottom: 0;
                }
              }
              .sender {
                font-weight: bold;
                overflow: hidden;
                white-space: nowrap;
                text-overflow: ellipsis;
                cursor: pointer;
                color: v.$softwhite;
                font-size: 0.8em;
                &::before {
                  content: "~";
                  margin-right: 3px;
                }
                &:has(.sw) {
                  font-weight: normal;
                }
              }
              .embed {
                padding: 5px;
                border-left: 3px solid v.$yellow;
                background-color: #00000020;
                border-top-left-radius: 10px;
                border-bottom-left-radius: 10px;
                color: v.$yellow;
                font-size: 0.8em;
                cursor: pointer;
                .name,
                .msg {
                  white-space: nowrap;
                  overflow: hidden;
                  text-overflow: ellipsis;
                }
              }
              .text {
                text-align: left;
                .msg {
                  font-size: 15.2px;
                  line-height: 1.5;
                  word-break: break-all;
                  word-break: break-word;
                  hyphens: auto;
                  user-select: text;
                  -webkit-tap-highlight-color: #b42751;
                  -webkit-touch-callout: #b42751;
                  -webkit-user-select: text;
                  -moz-user-select: text;
                  -ms-user-select: text;
                }
              }
              .time {
                display: flex;
                justify-content: end;
                align-items: center;
                gap: 10px;
                text-align: right;
                font-size: 0.8em;
                color: v.$softwhite;
              }
            }
            &:has(.avatar) {
              .optmenu {
                left: 55px;
              }
            }
            &.me {
              .field {
                max-width: calc(100% - (40px + 40px));
                margin-left: auto;
                margin-right: 0;
                background: v.$pm2;
              }
            }
            &:first-child {
              margin-top: 0;
            }
            &.show {
              visibility: visible;
              animation: popup 0.5s ease;
            }
          }
          .preload {
            position: sticky;
            top: 0;
            left: 0;
            width: 100%;
            padding: 20px;
            text-align: center;
            font-size: 1.2em;
            i {
              color: v.$pm1;
              font-size: 1.3em;
            }
          }
          &.asset-loading {
            .card {
              opacity: 0.025;
            }
          }
        }
      }
    }
    &#packages {
      background-color: v.$px1;
      padding: 20px;
      color: v.$softwhite;
      .box {
        max-width: 800px;
        margin: 0 auto;
        p {
          text-align: center;
        }
        .cre {
          margin-top: 0.5rem;
          display: flex;
          flex-wrap: wrap;
          justify-content: center;
          align-items: center;
          gap: 10px;
          a {
            font-size: 0.75rem;
            display: block;
            text-decoration: none;
            padding: 3px 5px;
            border-radius: 5px;
            background-color: v.$pm2;
          }
        }
      }
    }
    &#footer {
      background-color: v.$px25;
      color: v.$softwhite;
      .links {
        padding: 20px;
        display: flex;
        flex-wrap: wrap;
        -ms-flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 10px;
        a {
          display: block;
          text-decoration: none;
          color: v.$softwhite;
        }
      }
      .author {
        background-color: v.$px1;
        padding: 20px;
        font-size: 14px;
        p {
          line-height: 1.5;
          text-align: center;
          .nodec {
            text-decoration: none;
          }
        }
      }
    }
  }
}
