/* =========================================================
   OLD MIXTAPE — WEBDESKTOP
   Complete responsive stylesheet
   ========================================================= */


/* ------------------ BASIC BODY ------------------ */

* {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  overflow: visible;
}

body {
  font-family: Courier, monospace;
  background: #0a0018;
  color: #00fff7;
}


/* =========================================================
   DESKTOP / ICON AREA
   ========================================================= */

.desktop {
  padding: 20px;

  /*
    CSS Grid replaces the old flexbox layout.

    Icons fill DOWNWARD first, creating vertical columns.
    Five icons fit in each column on desktop.
  */
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(5, 100px);
  grid-auto-columns: 110px;

  column-gap: 20px;
  row-gap: 8px;

  align-items: start;
  align-content: start;
  justify-content: start;

  /*
    Keep the desktop icon area above the background
    but below windows and controls.
  */
  position: relative;
  z-index: 1;
}


/* ------------------ ICONS ------------------ */

.icon {
  cursor: pointer;
  text-align: center;
  color: white;

  /*
    Grid controls the positioning.
    No margin is used here because margin would
    interfere with the grid spacing.
  */
  display: block;
  width: 100px;
  height: 90px;
  margin: 0;

  overflow: hidden;

  user-select: none;
  -webkit-user-select: none;
}

.icon span {
  display: block;

  font-size: 14px;
  line-height: 16px;

  overflow-wrap: break-word;
  word-break: break-word;
}


/* =========================================================
   WINDOWS
   ========================================================= */

.window {
  position: absolute;

  top: 150px;
  left: 150px;

  width: 600px;
  height: 400px;

  background: #050510;
  border: 2px solid #00fff7;
  box-shadow: 0 0 20px #00fff7;

  z-index: 1000;

  display: none;

  max-width: 90vw;
  max-height: 80vh;

  overflow: hidden;
}


/* ------------------ WINDOW TITLEBAR ------------------ */

.window .titlebar {
  background: #ff00cc;
  color: black;

  padding: 5px;

  cursor: move;

  display: flex;
  justify-content: space-between;
  align-items: center;

  font-weight: bold;

  min-height: 30px;
}


/* ------------------ WINDOW CONTENT ------------------ */

.window .content {
  padding: 10px;

  width: 100%;
  height: calc(100% - 30px);

  overflow: auto;

  position: relative;
}


/* =========================================================
   WINDOW CLOSE BUTTON
   ========================================================= */

.window .close {
  background: black;
  color: #ff00cc;

  border: 1px solid #ff00cc;

  cursor: pointer;
}

.window .close:hover {
  background: #ff00cc;
  color: black;
}


/* =========================================================
   BUTTONS
   ========================================================= */

button {
  background: black;
  border: 1px solid #ff00cc;
  color: #ff00cc;

  cursor: pointer;
}

button:hover {
  background: #ff00cc;
  color: black;
}


/* =========================================================
   MUSIC PLAYLIST
   ========================================================= */

.playlist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.playlist li {
  cursor: pointer;
  padding: 4px;
}

.playlist li:hover {
  color: #ff00cc;
}


/* =========================================================
   TYPEWRITER
   ========================================================= */

textarea {
  width: 100%;
  height: 160px;

  background: black;
  color: #00ff9c;

  border: 1px solid #00fff7;

  font-family: Courier, monospace;

  padding: 8px;

  resize: vertical;
}


/* =========================================================
   GALLERY
   ========================================================= */

.gallery {
  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 6px;
}

.gallery img {
  width: 100%;
  height: auto;

  border: 2px solid #00fff7;

  cursor: pointer;

  display: block;
}


/* =========================================================
   IMAGE VIEWER
   ========================================================= */

#viewer {
  position: fixed;

  top: 0;
  left: 0;

  width: 100%;
  height: 100%;

  background: rgba(0, 0, 0, 0.9);

  display: none;

  justify-content: center;
  align-items: center;

  z-index: 99999;
}

#viewer img {
  max-width: 90%;
  max-height: 90%;

  object-fit: contain;
}


/* =========================================================
   FILE LIST
   ========================================================= */

.fileList {
  list-style: none;
  padding: 0;
  margin: 0;
}

.fileList li {
  margin: 6px 0;
}

.fileList a {
  color: #00fff7;
  text-decoration: none;
}

.fileList a:hover {
  color: #ff00cc;
}


/* =========================================================
   BACKGROUND GIF
   ========================================================= */

#gifBG {
  position: fixed;

  top: 0;
  left: 0;

  width: 100%;
  height: 100%;

  background-size: cover;
  background-position: center;

  z-index: -999;

  pointer-events: none;
}


/* =========================================================
   BACKGROUND SWITCH BUTTONS
   ========================================================= */

#bgButtons {
  position: fixed;

  bottom: 15px;
  right: 15px;

  z-index: 9999;
}

#bgButtons button {
  background: black;
  color: #ff00cc;

  border: 1px solid #ff00cc;

  margin: 3px;
  padding: 4px 8px;

  cursor: pointer;
}

#bgButtons button:hover {
  background: #ff00cc;
  color: black;
}


/* =========================================================
   SYNTHWAVE GRID
   ========================================================= */

body::before {
  content: "";

  position: fixed;

  bottom: 0;
  left: 0;

  width: 100%;
  height: 60%;

  background:
    linear-gradient(#ff00cc44 1px, transparent 1px),
    linear-gradient(90deg, #ff00cc44 1px, transparent 1px);

  background-size: 40px 40px;

  transform: perspective(400px) rotateX(60deg);
  transform-origin: bottom;

  pointer-events: none;

  z-index: 0;
}


/* =========================================================
   SCANLINES
   ========================================================= */

.scanlines {
  position: fixed;

  top: 0;
  left: 0;

  width: 100%;
  height: 100%;

  pointer-events: none;

  background:
    repeating-linear-gradient(
      transparent 0px,
      transparent 2px,
      rgba(0, 0, 0, 0.25) 3px
    );

  z-index: 9998;
}


/* =========================================================
   TASKBAR
   ========================================================= */

.taskbar {
  background: #ff00cc;
  color: black;

  text-align: center;

  padding: 8px;

  font-weight: bold;

  letter-spacing: 3px;

  position: relative;
  z-index: 100;
}


/* =========================================================
   FULLSCREEN WINDOWS
   ========================================================= */

.window:fullscreen {
  width: 100vw;
  height: 100vh;

  max-width: 100vw;
  max-height: 100vh;

  top: 0;
  left: 0;

  border: 0;
}


/* WebKit fullscreen support */

.window:-webkit-full-screen {
  width: 100vw;
  height: 100vh;

  max-width: 100vw;
  max-height: 100vh;

  top: 0;
  left: 0;

  border: 0;
}


/* ------------------ FULLSCREEN BUTTON ------------------ */

.window .fullscreen-btn {
  background: black;
  color: #00fff7;

  border: 1px solid #00fff7;

  cursor: pointer;

  margin-right: 4px;
}

.window .fullscreen-btn:hover {
  background: #00fff7;
  color: black;
}


/* =========================================================
   RESIZE HANDLE
   ========================================================= */

.resize-handle {
  position: absolute;

  width: 18px;
  height: 18px;

  right: -4px;
  bottom: -4px;

  cursor: nwse-resize;

  z-index: 6;

  background:
    linear-gradient(
      135deg,
      transparent 0 50%,
      rgba(255, 255, 255, 0.45) 50% 56%,
      transparent 56% 62%,
      rgba(255, 255, 255, 0.45) 62% 68%,
      transparent 68% 74%,
      rgba(255, 255, 255, 0.45) 74% 80%,
      transparent 80%
    );
}

.resize-handle:hover {
  background:
    linear-gradient(
      135deg,
      transparent 0 50%,
      rgba(255, 255, 255, 0.9) 50% 56%,
      transparent 56% 62%,
      rgba(255, 255, 255, 0.9) 62% 68%,
      transparent 68% 74%,
      rgba(255, 255, 255, 0.9) 74% 80%,
      transparent 80%
    );
}


/* ------------------ WINDOW RESIZING ------------------ */

.window {
  resize: both;

  overflow: hidden;

  min-width: 280px;
  min-height: 200px;
}


/*
  Fullscreen windows should not be manually resized.
*/
.window.is-fullscreen {
  resize: none;
}


/* =========================================================
   CANVAS
   ========================================================= */

canvas {
  width: 100%;
  height: 100%;

  display: block;
}


/* =========================================================
   GRID CONTROL BUTTONS
   ========================================================= */

.bgControls {
  position: absolute;

  bottom: 5px;
  left: 5px;

  z-index: 5;
}

.bgControls button {
  margin: 2px;
  padding: 4px 8px;

  border: 1px solid #ff00cc;

  background: black;
  color: #ff00cc;

  cursor: pointer;
}

.bgControls button:hover {
  background: #ff00cc;
  color: black;
}


/* =========================================================
   GENERAL RESPONSIVE MEDIA
   ========================================================= */

img,
iframe,
video {
  max-width: 100%;
}


/* =========================================================
   TABLET / SMALL DESKTOP
   ========================================================= */

@media (max-width: 1000px) and (min-width: 769px) {

  .desktop {
    padding: 15px;

    grid-template-rows: repeat(5, 105px);
    grid-auto-columns: 100px;

    column-gap: 15px;
    row-gap: 8px;
  }

  .icon {
    width: 90px;
    height: 85px;
  }

  .icon span {
    font-size: 13px;
    line-height: 15px;
  }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

  body {
    font-size: 16px;
  }


    /* ------------------ MOBILE ICON GRID ------------------ */

  .desktop {
    padding: 12px;

    /*
      Four icons vertically per column.

      This creates a compact phone-friendly desktop:
      
      ICON       ICON       ICON
      ICON       ICON       ICON
      ICON       ICON       ICON
      ICON       ICON       ICON
    */
    display: grid;

    grid-auto-flow: column;

    grid-template-rows: repeat(4, 95px);

    grid-auto-columns: 90px;

    column-gap: 10px;
    row-gap: 3px;

    align-items: start;
    align-content: start;
    justify-content: start;
  }


  /* ------------------ MOBILE ICONS ------------------ */

  .icon {
    width: 80px;
    height: 80px;

    margin: 0;

    overflow: hidden;
  }

  .icon span {
    font-size: 12px;
    line-height: 16px;
  }


  /* ------------------ MOBILE WINDOWS ------------------ */

  .window {
    width: 95vw;
    height: 70vh;

    left: 2.5vw;
    top: 10vh;

    max-width: 95vw;
    max-height: 80vh;

    min-width: 0;
    min-height: 0;
  }


  .window .content {
    padding: 8px;

    /*
      Make sure iframe/app content can scroll
      rather than forcing the window wider.
    */
    overflow: auto;
  }


  /* ------------------ MOBILE TEXTAREA ------------------ */

  textarea {
    width: 100%;
    max-width: 100%;

    font-size: 14px;
  }


  /* ------------------ MOBILE GALLERY ------------------ */

  .gallery {
    grid-template-columns: 1fr 1fr;

    gap: 4px;
  }


  /* ------------------ MOBILE BACKGROUND CONTROLS ------------------ */

  #bgButtons {
    bottom: 10px;
    right: 10px;

    max-width: calc(100vw - 20px);
  }

  #bgButtons button {
    margin: 2px;
    padding: 4px 6px;

    font-size: 12px;
  }


  /* ------------------ MOBILE TASKBAR ------------------ */

  .taskbar {
    padding: 7px 4px;

    font-size: 12px;

    letter-spacing: 2px;
  }


  /* ------------------ MOBILE FULLSCREEN ------------------ */

  .window:fullscreen,
  .window:-webkit-full-screen {
    width: 100vw;
    height: 100vh;

    max-width: 100vw;
    max-height: 100vh;

    top: 0;
    left: 0;
  }
}


/* =========================================================
   LANGUAGE FOLDER
   ========================================================= */

#languageWindow {
  width: 380px;
  height: 340px;
}

#languageWindow.is-fullscreen {
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  z-index: 99999 !important;
}

#languageWindow .folder-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 6px;
}

#languageWindow .folder-icons .icon {
  width: 90px;
  height: 90px;
}

@media (max-width: 768px) {
  #languageWindow {
    width: 95vw;
    height: 60vh;
    left: 2.5vw;
    top: 10vh;
  }

  #languageWindow.is-fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    left: 0 !important;
    top: 0 !important;
  }
}


/* =========================================================
   VERY SMALL PHONES
   ========================================================= */

@media (max-width: 400px) {

  .desktop {
    padding: 10px;

    grid-template-rows: repeat(4, 85px);
    grid-auto-columns: 70px;

    column-gap: 10px;
    row-gap: 5px;
  }

  .icon {
    width: 70px;
    height: 75px;
  }

  .icon span {
    font-size: 11px;
    line-height: 13px;
  }


  .window {
    width: 96vw;

    left: 2vw;

    height: 75vh;

    top: 8vh;
  }
}