@font-face {
  font-family: "dosv-jpn12";
  src: url("../fonts/Web437_DOS-V_re_JPN12.woff") format("woff");
}

@font-face {
  font-family: "cga-thin";
  src: url("../fonts/WebPlus_IBM_CGAthin.woff") format("woff");
}

@font-face {
  font-family: "cga-mda";
  src: url("../fonts/WebPlus_IBM_MDA.woff") format("woff");
}

@font-face {
  font-family: "home-video";
  src: url("../fonts/HomeVideo-BLG6G.ttf") format("truetype");
}

@font-face {
  font-family: "home-video-opaque";
  src: url("../fonts/HomeVideoBold-R90Dv.ttf") format("truetype");
}

@font-face {
  font-family: "teletactile";
  src: url("../fonts/Teletactile-3zavL.ttf") format("truetype");
}

@font-face {
  font-family: "kindly-rewind";
  src: url("../fonts/KindlyRewind-BOon.ttf") format("truetype");
}

:root {
  --font-color: rgb(1, 218, 1);
  --window-border-color: rgb(0, 89, 82);
}

body {
  display: flex;
  flex-direction: column;
  font:
    1.3rem Cascadia,
    monospace;
  background-color: black;
  background-image: url("../img/bg3.jpg");
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
  margin: 0;
  padding: 0;
  min-height: 100dvh;
}

main {
  display: flex;
  margin-top: 3rem;
  padding: 0 3rem;
}

a,
li {
  all: unset;
  color: var(--font-color);
}

li {
  display: block;
}

a {
  all: unset;

  &:hover {
    cursor: pointer;
  }
}

@keyframes floatText {
  to {
    transform: translateX(-100%);
  }
}

header {
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgb(80, 119, 119);
  font-family: "dosv-jpn12";
  color: white;
  padding: 0 2rem;
  height: 3rem;

  background: linear-gradient(180deg, #006d64 0%, #003f3a 100%);

  border-left: 2px solid #01e2cf;
  border-top: 2px solid #01e2cf;
  border-bottom: 2px solid #00443e;
  border-right: 2px solid #00443e;
  font-size: 1.4rem;

  user-select: none;

  p {
    font-size: 1.4rem;
  }

  #music-player {
    display: flex;
    gap: 1rem;
    align-items: center;

    #track-display {
      background-color: black;
      width: 25rem;
      height: 2rem;
      overflow: hidden;
      border-top: 2px solid #00443e;
      border-left: 2px solid #00443e;
      border-right: 2px solid #01e2cf;
      border-bottom: 2px solid #01e2cf;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      position: relative;

      p {
        margin: 0;
        display: flex;
        align-items: center;
      }

      span {
        line-height: 1;
      }

      #track-name {
        flex: 1;
        overflow: hidden;
        border-right: 2px solid rgb(61, 61, 61);
        height: 100%;

        span {
          color: orange;
          font-size: 1rem;
          display: inline-block;
          white-space: nowrap;
          animation: floatText 20s infinite linear;
          padding-left: 100%;
        }
      }

      #track-duration {
        color: orange;
        font-size: 1rem;
        white-space: nowrap;
        padding: 0 1rem;
      }
    }

    #player-controls {
      display: flex;
      border-right: 2px solid #01e2cf;
      border-bottom: 2px solid #01e2cf;
      border-top: 2px solid #00443e;
      border-left: 2px solid #00443e;
      align-items: center;
      background-color: rgb(28, 35, 39);
      height: 1.9rem;

      #control-buttons {
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 1.2rem;

        button {
          all: unset;
          display: flex;
          align-items: center;
          justify-content: center;
          width: 2rem;
          height: 2rem;
          min-width: 1rem;
          min-height: 1rem;
          font-size: 1.2rem;
        }

        #play-pause {
          width: 24px;
          height: 24px;
          border: none;
          cursor: pointer;
          margin: 0.25rem 0.25rem;
          padding: 0 0.25rem;
          border-right: 2px solid rgb(27, 27, 27);
          border-left: 2px solid rgb(58, 58, 58);
          border-bottom: 2px solid rgb(27, 27, 27);
          border-top: 2px solid rgb(58, 58, 58);

          #play-pause-icon {
            width: 1rem;
            height: 1rem;
          }
        }

        #play-pause:active {
          border-left: 2px solid rgb(27, 27, 27);
          border-right: 2px solid rgb(58, 58, 58);
          border-top: 2px solid rgb(27, 27, 27);
          border-bottom: 2px solid rgb(58, 58, 58);
        }

        #stop {
          width: 24px;
          height: 24px;
          border: none;
          cursor: pointer;
          margin: 0.25rem 0.25rem;
          padding: 0 0.25rem;
          border-right: 2px solid rgb(27, 27, 27);
          border-left: 2px solid rgb(58, 58, 58);
          border-bottom: 2px solid rgb(27, 27, 27);
          border-top: 2px solid rgb(58, 58, 58);

          #stop-icon {
            width: 1rem;
            height: 1rem;
          }
        }

        #stop:active {
          border-left: 2px solid rgb(27, 27, 27);
          border-right: 2px solid rgb(58, 58, 58);
          border-top: 2px solid rgb(27, 27, 27);
          border-bottom: 2px solid rgb(58, 58, 58);
        }
      }

      #track-slider {
        width: 100%;
        appearance: none;
        -webkit-appearance: none;
        background: #505050;
        height: 3px;
        border-radius: 3px;
        cursor: pointer;
        margin: 0 0.5rem;
      }

      #track-slider::-webkit-slider-thumb,
      #track-slider::-moz-range-thumb {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: rgb(63, 63, 63);
        border: 1px solid #1d1d1d;
      }
    }
  }

  #volume-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: monospace;
    color: #00d8ff;
    background-color: rgb(34, 34, 34);
    height: 1.9rem;
    border-right: 2px solid #01e2cf;
    border-bottom: 2px solid #01e2cf;
    border-top: 2px solid #00443e;
    border-left: 2px solid #00443e;
    padding: 0 0.5rem;

    #volume-icon {
      all: unset;
      width: 24px;
      height: 24px;
      background-image: url("../img/volume.svg");
      background-size: contain;
      background-repeat: no-repeat;
      background-position: center;
      border: none;
      cursor: pointer;
    }

    /* Slider de volume style PC505 */
    #volume-slider {
      -webkit-appearance: none;
      appearance: none;
      width: 100px;
      height: 12px;
      background: #111;
      outline: none;
      cursor: pointer;
      position: relative;
      background-image: repeating-linear-gradient(
        to right,
        #0044aa,
        #0044aa 2px,
        #00d8ff 2px,
        #00d8ff 4px
      );
      background-size: 20% 100%;
      background-repeat: no-repeat;
    }

    #volume-slider::-webkit-slider-thumb {
      -webkit-appearance: none;
      width: 16px;
      height: 16px;
      background: #00d8ff;
      border-radius: 50%;
      border: 1px solid #0044aa;
      margin-top: -2px;
    }

    #volume-slider::-moz-range-track {
      height: 12px;
      border-radius: 3px;
      background: #111;
    }

    #volume-slider::-moz-range-progress {
      background: repeating-linear-gradient(
        to right,
        #0044aa,
        #0044aa 2px,
        #00d8ff 2px,
        #00d8ff 4px
      );
    }

    #volume-slider::-moz-range-thumb {
      width: 8px;
      height: 16px;
      background: #00d8ff;
      border-radius: 0;
      border: 1px solid #0044aa;
    }

    #volume-slider::-ms-track {
      width: 100%;
      height: 12px;
      background: transparent;
      border-color: transparent;
      color: transparent;
    }

    #volume-slider::-ms-fill-lower {
      background: repeating-linear-gradient(
        to right,
        #0044aa,
        #0044aa 2px,
        #00d8ff 2px,
        #00d8ff 4px
      );
      border-radius: 3px;
    }

    #volume-slider::-ms-fill-upper {
      background: #111;
      border-radius: 3px;
    }

    #volume-value {
      width: 2rem;
      text-align: right;
      font-size: 0.9rem;
    }
  }

  audio {
    display: none;
  }
}

#selectors {
  font-family: "VT323", monospace;
  font-weight: 400;
  font-style: normal;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 28rem;
}

#tags {
  font-size: 1rem;
  height: auto;
  overflow-y: auto;

  .panel-content {
    #resetTags {
      all: unset;
      color: rgb(1, 218, 1);
      width: 100%;
      margin: 0.5rem 0;

      &:hover {
        cursor: pointer;
        background-color: rgb(0, 53, 53);
      }

      &:active {
        background-color: rgb(4, 226, 226);
      }
    }

    #resetTags {
      text-align: center;
    }

    ul {
      text-align: center;
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      flex-wrap: wrap;
      gap: 0.5rem;
      padding: 0;
      margin: 0.5rem 0;

      li {
        &:hover {
          cursor: pointer;
          background-color: rgb(0, 53, 53);
        }

        &:active {
          background-color: rgb(4, 226, 226);
        }
      }

      .active {
        background-color: #410606;
        color: #fff;
      }
    }
  }
}

#entries {
  font-size: 1.2rem;
  height: auto;
  max-height: 30rem;
  overflow-y: scroll;
  overflow-x: hidden;

  ul {
    padding-left: 0.2rem;
    margin: 0;
    list-style: none;
  }

  li {
    padding: 0.2rem 0;
  }

  li:hover {
    cursor: pointer;
    background-color: rgb(0, 53, 53);
  }

  li:active {
    background-color: rgb(4, 226, 226);
  }
}

.panel {
  background-color: rgba(0, 0, 0, 0.7);
  border: 2px solid var(--window-border-color);

  .panel-header {
    background: #000000;
    background: linear-gradient(
      0deg,
      rgba(0, 0, 0, 1) 0%,
      rgba(0, 89, 82, 1) 100%
    );
    /* background: radial-gradient(
      circle,
      rgba(0, 0, 0, 1) 0%,
      rgba(0, 33, 31, 1) 67%,
      rgba(0, 89, 82, 1) 100%
    ); */
    color: rgb(255, 255, 255);
    padding: 0 0.5rem;
    font-family: "cga-thin";
    text-shadow:
      -1px -1px 0 rgb(204, 204, 204),
      1px -1px 0 rgb(129, 129, 129),
      -1px 1px 0 rgb(65, 65, 65),
      1px 1px 0 rgb(0, 0, 0);
    font-size: 0.7rem;
    position: sticky;
    top: 0;
    display: block;
    width: 100%;
    box-sizing: border-box;
    user-select: none;
  }

  .panel-content {
    padding: 0 0.5rem;
  }
}

#entries::-webkit-scrollbar,
#tags::-webkit-scrollbar,
#content::-webkit-scrollbar {
  width: 30px;
  height: 24px;
}

#entries::-webkit-scrollbar-track,
#tags::-webkit-scrollbar-track,
#content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 0;
}

#entries::-webkit-scrollbar-thumb,
#tags::-webkit-scrollbar-thumb,
#content::-webkit-scrollbar-thumb {
  background-color: var(--font-color);
  border-radius: 0;
  border: none;
}

#entries::-webkit-scrollbar-button,
#tags::-webkit-scrollbar-button,
#content::-webkit-scrollbar-button {
  display: none;
}

#entries,
#tags,
#content {
  scrollbar-width: thin;
  scrollbar-color: var(--font-color) rgba(0, 0, 0, 0.3);
}

#content {
  flex: 1;
  color: var(--font-color);
  margin-left: 3rem;
  height: 48rem;
  overflow-y: scroll;
  overflow-x: hidden;

  #entry {
    #entry-meta {
      display: flex;
      flex-direction: column;
      flex: 1;
      background-color: gray;

      #entry-date,
      #entry-tags {
        font-family: "cga-mda";
        color: black;
        font-size: 0.9rem;
        padding: 0 1rem;
      }
    }

    #entry-content {
      padding: 1rem 2.2rem;
      box-sizing: border-box;
      text-align: justify;
      white-space: pre-wrap;
      font-size: 1.1rem;
    }
  }
}

#window-btns {
  display: flex;
  gap: 3rem;

  button {
    all: unset;
    cursor: pointer;
    border: 2px solid gray;
    padding: 1rem;
    border-right: 2px solid #01e2cf;
    border-left: 2px solid #01e2cf;
  }
}

#bio-window {
  font-size: 2rem;

  .window-content {
    display: flex;

    #bio-text {
      font-size: 0.9rem;

      #bio-contact {
        border: 4px double green;
        margin-top: 0.5rem;
        padding: 1rem;
        width: 50%;

        a {
          display: flex;
          align-items: center;
          gap: 1rem;
        }

        #discord-logo {
          width: 2rem;
          height: 2rem;
          background-image: url("../img/discord-logo.svg");
          background-size: contain;
          background-repeat: no-repeat;
          background-position: center;
          border: none;
          cursor: pointer;
        }

        #steam-logo {
          width: 2rem;
          height: 2rem;
          background-image: url("../img/steam-logo.svg");
          background-size: contain;
          background-repeat: no-repeat;
          background-position: center;
          border: none;
          cursor: pointer;
        }
      }
    }

    img {
      width: 10rem;
      height: auto;
      object-fit: contain;
    }
  }
}

#wisdom-window {
  width: 40rem;
  height: 30rem;
  position: absolute;
  background-color: #000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

#wisdom-window .window-header {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  background: radial-gradient(
    circle,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 33, 31, 1) 67%,
    rgba(0, 89, 82, 1) 100%
  );
  color: #fff;
  font-family: "cga-thin";
  font-size: 0.7rem;
  text-shadow:
    -1px -1px 0 #ccc,
    1px -1px 0 #818181,
    -1px 1px 0 #414141,
    1px 1px 0 #000;
  padding: 4px 6px;
  cursor: grab;
  z-index: 9999;
}

#wisdom-window.is-dragging .window-header {
  cursor: grabbing;
}

#wisdom-window .window-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#wisdom-window .window-content video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none;
}

#wisdom-window .window-content p {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: 2rem;
  font-family: "home-video", monospace;
  text-align: center;
  text-shadow:
    0 0 1px #fff,
    0 0 2px #fff,
    0 0 3px #fff;
  animation: vhsShake 0.15s infinite linear;
  transform: translate(-2px, 2px) rotate(-0.5deg);
}

@keyframes vhsShake {
  0% {
    transform: translate(0px, 0px) rotate(0deg);
  }
  10% {
    transform: translate(-1px, 1px) rotate(-0.2deg);
  }
  20% {
    transform: translate(1px, -1px) rotate(0.3deg);
  }
  30% {
    transform: translate(-1px, 0px) rotate(-0.3deg);
  }
  40% {
    transform: translate(0px, 1px) rotate(0.2deg);
  }
  50% {
    transform: translate(1px, -1px) rotate(-0.1deg);
  }
  60% {
    transform: translate(-1px, 1px) rotate(0.1deg);
  }
  70% {
    transform: translate(1px, 0px) rotate(-0.2deg);
  }
  80% {
    transform: translate(0px, -1px) rotate(0.2deg);
  }
  90% {
    transform: translate(-1px, 1px) rotate(-0.1deg);
  }
  100% {
    transform: translate(0px, 0px) rotate(0deg);
  }
}

@media only screen and (max-width: 1200px) {
  header {
    p {
      font-size: 1.1rem;
    }

    #music-player {
      #track-display {
        width: 19rem;
      }

      #player-controls {
        width: 12rem;

        #control-buttons {
          #stop,
          #play-pause {
            width: 16px;
            height: 16px;
          }
        }
      }

      #volume-container {
        width: 8rem;

        #volume-icon {
          background-size: 18px;
          width: 18px;
        }

        #volume-slider {
          width: 4rem;
        }

        #volume-value {
          width: 0.5rem;
          font-size: 0.8rem;
        }
      }
    }

    #window-btns {
      gap: 0;

      * {
        font-size: 1rem;
      }
    }
  }

  #selectors {
    width: auto;
  }
}

@media only screen and (max-width: 980px) {
  header {
    flex-direction: column;
    height: auto;
    padding: 0;
    justify-content: center;
    align-items: center;

    & > p {
      display: flex;
      justify-content: center;
      align-items: center;
      text-align: center;
      font-size: 1.4rem;
      border-bottom: 1px solid #01e2cf;
      width: 100%;
      padding: 1rem 0;
      margin: 0;
    }

    #music-player {
      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: center;
      border-bottom: 1px solid #01e2cf;
      width: 100%;
      gap: 1rem;
      padding: 1rem 0;
      margin: 0;

      #track-display {
        width: 22rem;
      }
    }

    #window-btns {
      display: flex;
      justify-content: center;
      align-items: center;
      height: auto;
      gap: 0.5rem;
      overflow: hidden;
      * {
        border-top: none;
        border-bottom: none;
      }
    }
  }

  main {
    flex-direction: column;
    margin: 1rem;

    #selectors {
      flex-direction: row;
      justify-content: center;
      margin: 1rem 0;
      height: auto;

      .panel {
        width: 50%;
      }
    }

    #content {
      margin: 0;

      #entry {
        max-height: 30rem;
      }
    }
  }
}

@media only screen and (max-width: 750px) {
  header {
    & > p {
      font-size: 1rem;
      padding: 0.5rem 0;
    }

    #music-player {
      flex-wrap: wrap;
      padding: 0.5rem 0;
      gap: 0.3rem;

      #track-display {
        width: 28rem;
        height: 1.3rem;
      }

      #player-controls,
      #volume-container {
        width: 50%;
        height: 1.5rem;
      }

      #volume-container {
        width: 8rem;
      }
    }

    #window-btns {
      height: 2rem;
    }
  }

  main {
    margin-top: 1rem;
    padding: 0 0.5rem;

    #selectors {
      flex-direction: column;

      #tags,
      #entries {
        font-size: 1rem;
        width: 100%;
        height: 8rem;
      }

      .panel {
        width: 100%;
      }
    }

    #entries {
      font-size: 0.9rem;
    }

    #content {
      #entry {
        height: 30rem;

        #entry-meta {
          height: auto;

          #entry-date,
          #entry-tags {
            font-size: 0.8rem;
          }
        }

        #entry-content {
          font-size: 1rem;
        }
      }
    }
  }
}

@media only screen and (hover: none) {
  main {
    margin-top: 0;
    padding: 0 1rem;

    .panel {
      .panel-header {
        font-size: 0.5rem;
      }
    }

    #selectors {
      height: 10rem;
      #tags {
        .panel-content {
          height: 5rem;
          font-size: 0.8rem;
          #resetTags {
            margin: 0;
          }
        }
      }

      #entries {
        font-size: 0.8rem;
      }

      #tags,
      #entries {
        height: 12rem;
        overflow-y: scroll;
        scrollbar-gutter: stable;
      }
    }

    #content {
      #entry {
        #entry-meta {
          #entry-date,
          #entry-tags {
            font-size: 0.6rem;
          }
        }

        #entry-content {
          font-size: 0.7rem;
          padding: 0.8rem;
        }
      }
    }
  }

  #bio-window {
    width: 20rem;

    .window-content {
      display: flex;

      #bio-text {
        font-size: 0.6rem;

        #discord-logo,
        #steam-logo {
          width: 2rem;
          height: 2rem;
        }
      }

      img {
        width: 7rem;
      }
    }
  }

  #wisdom-window {
    width: 20rem;
    height: 18rem;
  }

  .window-header .window-title {
    font-size: 0.5rem;
  }

  #wisdom-window .window-content p {
    font-size: 1.5rem;
  }
}
