html, body {
    margin: 0;
    padding: 0;
    overflow:hidden;
}

#center {
    max-width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.box-icons1 {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    margin-left: 2vw;
    margin-top: 9vh;
    width: 20vw;
    gap: 2vw 2vh;
    position: absolute;
}

.box-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0px;
    user-select: none;
}

.box-icon img {
    object-fit:scale-down;
    height: 7vh;
}

.pclogo-pc {
    padding-top: 4vh;
}

#shadow {
    background: linear-gradient(180deg, rgba(2,0,36,0.1) 70%, rgba(0,0,0,0.6) 100%);
    height: 100vh;
    width: 100%;
    position: absolute;
    z-index: -2;
}

#wallpaper {
    height: 100vh;
    width: 100vw;
    object-fit: cover;
    z-index: -3;
    position: absolute;
}

.app-shadow {
    box-shadow: rgba(0,0,0,0.4) 0 4px 14px;
}

.app {
    resize:both;
    overflow:hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #ffffff;
    position: absolute;    
    border-radius: 4px;
}

.appname {
    font-size: 1.4vh;
}

#music {
  min-width: 70vw;
  min-height: 60vh;
  width: 12vw;
  height: 8vh;
  top: 12vh;
  left: 12vw;
}

#photos {
  min-width: 57vw;
  min-height: 68vh;
  width: 12vw;
  height: 14vh;
  top: 17vh;
  left: 14vw;
}

#paint {
  min-width: 47vw;
  min-height: 50vh;
  width: 12vw;
  height: 50vh;
  top: 16vh;
  left:13vw;
}

#platformer {
  min-width: 57vw;
  min-height: 55vh;
  width: 12vw;
  height: 50vh;
  top: 16vh;
  left:13vw;
  resize: none;
}

#musicheader, #photosheader, #pagesheader, #gameheader, #photoviewerheader, #chatheader, #paintheader, #platformerheader {
    position: relative;
    top: 0;
    height: 3%;
    width: 100%;
    background-image: linear-gradient(180deg, #ffffff 0%,#e4e4e4 100%);
    border-bottom: 1px solid rgb(199, 199, 199);
    display: flex;
    justify-content: space-between;
    padding: 2px;
}

#musicheader, #photosheader, #gameheader, #videosheader a, #musicheader, #photosheader, #articlesheader, #chatheader, #videosheader, #paintheader, #platformerheader {
    display: flex;
    align-items: center;
}

#box-appactions {
    display: flex;
    flex-direction: row;
    padding-left: 0.4vw;
    align-items: center;
}

#box-appactions a {
  display: flex;
  align-items: center;
}

#box-appactions a img {
    margin-right: 4px;
    height: 1.4vh;
}

#musictopbar {
    background-image: linear-gradient(180deg, #E5E5E5 0%, #D0D0D0 100%);
    max-height: 8%;
    width: 100%;
    border-bottom: 1px solid #AEAEAE;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

#nowplayingbar {
    background-color: #E8E8E8;
    width: 38%;
    height: 100%;
    border-right: 1px solid #d1d1d1;
    border-left: 1px solid #d1d1d1;
}

#chat {
    min-width: 20vw;
    min-height: 40vh;
    width: 22vw;
    height: 50vh;
    top: 15vh;
    left: 40vw;
}

#notplayingbar {
  background-color: #f8f8f8;
  width: 38%;
  height: 100%;
  border-right: 1px solid #d1d1d1;
  border-left: 1px solid #d1d1d1;
  -webkit-user-drag: none;
  user-select: none;
}

.volumeslider {
    -webkit-appearance: none;
    appearance: none;
    max-width: 30%;
    height: 0.4vh;
    background: #707070;
    outline: none;
    border-radius: 10px;
  }

.volumeslider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 15px;
    width: 15px;
    background: #ffffff;
    cursor: url(../ui/grab.svg), pointer;
    border-radius: 100%;
    box-shadow: rgba(0, 0, 0, 0.39) 0 2px 5px;
  }

  #nowplaying-song {
    font-family: 'Creato Display', sans-serif;
    font-size: 1.5vh;
    text-overflow: ellipsis;
    text-align: center;
    position: relative;
    display: inline-block;
    text-decoration: none;
    color: #000;
    flex-wrap: wrap;
    white-space: nowrap;
    width: 95%;
  }

  #nowplaying-info {
    font-family: 'Creato Display', sans-serif;
    font-size: 1.2vh;
    opacity: 0.6;
    cursor: url(../ui/point.svg), pointer;
  }

  #nowplaying-artist {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #nowplaying-album {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #searchbarbox {
    appearance: none;
    border: 1px solid gray;
    border-radius: 4px;
    background-image: url('https://www.w3schools.com/css/searchicon.png');
    object-fit: contain;
    background-size: 1.5vh;
    background-position: 4px 3px;
    background-repeat: no-repeat;
    padding-left: 23px;
    font-size: 1.4vh;
    box-shadow: rgba(0, 0, 0, 0.3) inset 0 0 4px;
    font-family: 'Creato Display', sans-serif;
    height: 2vh;
  }

  #musiccontrol a img {
    object-fit: contain;
    height: 1.5vh;
  }

  #musiccontrol a {
    display: flex;
  }

  .sortbybutton {
    display:flex;
    align-items: center;
    padding-left: 7%;
    padding-top: 2%;
    padding-bottom: 2%;
    user-select: none;
  }

  .sortbybutton:hover {
    background-color: rgba(0, 0, 0, 0.1);
  }

  .sortbybutton img {
    object-fit: cover;
    height: 1.7vh;
    margin-right: 3%;
  }

  .sortbybutton span {
    font-family: 'Creato Display', sans-serif;
    font-size: 1.5vh;
    letter-spacing: 0.4px;
  }

  .sortedmusicbutton, .sortedphotosbutton {
    padding-left: 0.7vw;
    padding-top: 0.8vh;
    padding-bottom: 0.8vh;
    display: flex;
    align-items: center;
  }

  .sortedmusicbutton:hover, .sortedphotosbutton:hover {
    background-color: rgba(0, 0, 0, 0.1);
  }

  .sortedmusicbutton:active, .sortedphotosbutton:active {
    background-color: rgba(0, 0, 0, 0.3);
  }

  .sortedmusicbutton img {
    object-fit: cover;
    height: 5vh;
    width: 5vh;
    border-radius: 5vh;
    box-shadow: rgba(0, 0, 0) inset 2px 2px 2px;
    user-select: none;
    -webkit-user-drag: none;
  }

  .sortedmusicbutton span, .sortedphotosbutton span {
    font-family: 'Creato Display', sans-serif;
    margin-left: 4%;
    font-size: 1.5vh;
    user-select: none;
    -webkit-user-drag: none;
  }

  #sortedalbumlist {
    background-color: white; 
    width: 80%; 
    height: 100%; 
    overflow-y: scroll; 
    overflow-x:hidden; 
    padding: 0;
  }

  .sortedalbum {
    padding-bottom: 3%;
    border-bottom: 1px solid #cacaca;
    padding-top: 2%;
  }

  .album-namedate {
    font-family: 'Creato Display', sans-serif;
    display: flex;
    justify-content: space-between;
  }

  #selectedartistname, .sort-year {
    font-family: 'Creato Display', sans-serif; 
    font-size: 2.4vh; 
    font-weight: bold;
  }

  .album-name {
    font-size: 1.7vh;
    font-weight: bold;
    font-family: Arial, 'Creato Display', sans-serif;
  }

  .album-date {
    font-size: 1.4vh;
    font-weight: light;
    opacity: 0.6;
    font-family: Arial, 'Creato Display', sans-serif;
  }

  .album-cover {
    object-fit: cover;
    height: 100%;
    width: 100%;
    max-height: 150px;
    max-width: 150px;
    border-radius: 2px;
    margin-top: 2%;
    -webkit-user-drag: none;
  }

  .trackmargin {
    margin-top: 3%;
  }

  .album-tracklength {
    opacity: 0.6;
  }

  .album-track {
    border: 0;
    border-bottom: 1px solid #cacaca;
    width: 100%;
    height: fit-content;
    display: flex;
    justify-content: space-between;
    font-family: 'Creato Display', sans-serif;
    font-size: 1.4vh;
    padding: 4px;
    background-color: rgba(0, 0, 0, 0);
  }

  .album-trackname {
    flex-wrap: wrap;
    text-align: left;
  }

  
  .album-track:active {
    background-color: rgba(0, 0, 0, 0.1);
  }

  .hidden {
    display: none;
  }

  #albumstack {
    height: 1px; 
    width: 100%; 
    background-color: rgb(202, 202, 202); 
    margin-top: 0.5vh; 
    margin-bottom: 1vh;
  }

  .sortbycolor {
    height: min-content;
    width: auto;
    padding: 3%;
    display: flex; 
    flex-direction: row;
    row-gap: 3px;
    column-gap: 3px;
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .colorbox {
    height: 15px;
    width: 15px;
  }

  .colorbox:active {
    box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
  }

  .colorbox.selected {
  border: 1px solid black;
  }

  #photolist-box {
    width: 60%;
    padding: 1.5%;
  }

  #sort-year {
    font-family: Arial, 'Creato Display', sans-serif;
    font-weight: bold;
    font-size: 2.5vh;
  }

  #photolist {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: stretch;
    row-gap: 1.5vh;
    column-gap: 1vh;
  }

  .photopreview {
    height: 14vh;
    width: 12vh;
  }

  .photopreview-text span {
    font-size: 1.6vh;
    color: rgb(0, 0, 0);
    opacity: 0.95;
    font-family: Arial, 'Creato Display', sans-serif;
  }

  .photopreview img {
    width: 14vh;
    height: 14vh;
    object-fit: cover;
    box-shadow: #70707091 0px 2px 5px;
    margin-bottom: 0.3vh;
  }

  .photopreview-img {
    user-select: none;
  }

  #songprogress {
    position: absolute;
  }

#songprogress {
  -webkit-appearance: none;
  appearance: none;
  width: 38%;
  height: 3px;
  background: #afafaf;
  background-image: linear-gradient(#6d6d6d, #6d6d6d);
  background-repeat: no-repeat;
  background-size: 0% 100%;
  margin: 0;
  align-self: flex-end;
  cursor: url(../ui/cursor.svg), pointer;
}

/* Thumb */
#songprogress::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  width: 3px;
  background: #383838;
  cursor: url(../ui/grab.svg), pointer;
  margin-top: -2px;
  border: none;
}

#songprogress::-moz-range-thumb {
  height: 3px;
  width: 3px;
  background: #6d6d6d;
  cursor: url(../ui/cursor.svg), pointer;
  border: none;
}

#songprogress::-moz-range-track {
  background: #afafaf;
  height: 3px;
}

.found-album {
  width: 120px;
  font-family: sans-serif;
  user-select: none;
}

.found-artist {
  width: 120px;
  font-family: sans-serif;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.found-album img {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 5px;
}

.found-artist img {
  width: 100%;
  border-radius: 100%;
  display: block;
  margin-bottom: 15px;
}

.found-album-info {
  display: flex;
  flex-direction: column;
}

.found-album-name {
  font-size: 15px;
  color: #222;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.found-album-artist {
  font-size: 12px;
  color: #858585;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#searchresults-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

#searchresults {
  overflow-y: scroll;
}

#repeat-button, #play-button, #musicvolume, #song-next, #song-previous, #nowplaying-info, .app-close, .close, .photo-grid img, .zoom-out, .zoom-in, .download {
  cursor: url(../ui/point.svg), pointer;
}

.modal {
  position: fixed;
  z-index: 1000;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.705);
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 80vh;
  box-shadow: 0 0 20px white;
  border-radius: 8px;
}

.close {
  position: absolute;
  top: 30px;
  right: 45px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  user-select: none;
}

.album-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  column-gap: 3vh;
  row-gap: 4vh;
  padding-top: 1vh;
}

.photo-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  column-gap: 0.5vh;
  padding-top: 1vh;
}

.photo-grid img {
  height: 15vh;
  width: 15vh;
  object-fit: cover;
}

.fade-out {
  opacity: 0;
  transition: opacity 0.1s ease;
}

.fade-in {
  opacity: 1;
  transition: opacity 0.1s ease;
}

.photoviewer-controlbar button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  user-select: none;
  padding: 4px 8px;
  transition: background-color 0.2s ease;
}

.photoviewer-controlbar button:hover {
  background-color: #ddd;
}

.photoviewer-controlbar {
  user-select: none;
}

/* Cursor styles for pan */
.photoviewer-window div[style*="cursor: grab"] {
  cursor: grab;
}

.photoviewer-window div[style*="cursor: grabbing"] {
  cursor: grabbing;
}

#imgContainer {
  transform-origin: center center;
  /* or */
  transform-origin: 50% 50%;
}

.zoom-in {
  margin-right: 1vw;
}

.zoom-out {
  margin-left: 1vw;
}

.photoviewer-controlbar {
  display: flex;
  width: 100%;
  padding: 2px;
  align-items: center;
  background: #c2c2c2 !important;
  background: linear-gradient(180deg,rgba(222, 222, 222, 1) 0%, rgba(227, 227, 227, 1) 50%, rgba(222, 222, 222, 1) 100%) !important;
}

.photoviewer-controlbar button {
  background-color: rgb(255, 255, 255) !important;
  border: none;
  padding: 6px;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 20px;
  border-radius: 4px;
  padding: 0;
  margin-right: 0.3vw;
  margin-top: 0.2vh;
  margin-bottom: 0.2vh;
}

.zoom-in {
  margin-right: 2vw !important;
}

.photoviewer-controlbar svg,
.photoviewer-controlbar img {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

/* Paint App Container Logic */
#paint #maininfobox {
    overflow: hidden !important; /* Prevents controls from spilling out */
}

.canvas-container {
    flex-grow: 1; /* Takes up all remaining space */
    background-color: #808080; /* Dark grey background for contrast */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

#drawing-canvas {
    background: rgb(235, 223, 173);
    cursor: crosshair;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.2);
}

.paint-controls {
    height: 50px;
    background: #e4e4e4;
    border-top: 1px solid #999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    flex-shrink: 0; /* Prevents bar from shrinking if window is small */
    user-select: none;
}

.colors {
    display: flex;
    gap: 4px;
    align-items: center;
}

.color-swatch {
    width: 20px;
    height: 20px;
    border: 1px solid #000;
    cursor: pointer;
    box-shadow: inset 1px 1px 0 rgba(255,255,255,0.5);
}

.color-swatch.selected {
    outline: 2px solid #555;
    box-shadow: inset 2px 2px 2px rgba(0,0,0,0.5);
}

/* Fix for color input appearance */
#custom-color-picker {
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}

.actions {
    display: flex;
    gap: 5px;
}

.actions button {
    cursor: pointer;
    font-family: 'Creato Display', sans-serif;
    font-size: 1.2vh;
}

/* --- 1. The Container on the Desktop --- */
#desktop-sticky-container {
    position: absolute;
    top: 5vh;
    right: 2vw;
    width: 25vw;        /* Width of the notes area */
    height: 85vh;
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 columns */
    grid-auto-rows: 15vh;           /* Height of each row */
    gap: 15px;
    padding: 10px;
    z-index: 1;         /* Above wallpaper (-1), below apps (80+) */
    pointer-events: none; /* Allows clicks to pass through empty spaces to icons */
}

/* --- 2. The Sticky Note Style --- */
.sticky-note {
    position: relative;
    width: 100%;
    height: 100%;
    
    /* Background Image Settings (for your note pngs) */
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    
    /* Centering the drawing inside the note */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px; /* Padding so drawing doesn't touch edges */
    box-sizing: border-box;
    
    /* Shadows and Transitions */
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.2));
    pointer-events: auto; /* Re-enable clicks for the notes themselves */
    
    /* Transition for the 'Unblur' effect */
    transition: opacity 1s ease, filter 1s ease, transform 0.2s ease;
    opacity: 1;
    filter: blur(0px);
}

.sticky-note:hover {
    transform: scale(1.1) rotate(0deg) !important; /* Pop up on hover */
    z-index: 10;
}

/* The Drawing Image inside the note */
.sticky-note img {
    width: 90%;
    height: 90%;
    object-fit: contain; /* Ensures drawing doesn't stretch weirdly */
    transform: rotate(-2deg); /* Slight rotation for realism */
}

/* --- 3. Animation State: Entering --- */
/* This class is added by JS for 50ms when note first appears */
.sticky-note.entering {
    opacity: 0;
    filter: blur(20px);
}

/* --- 4. Animation: The Flying Art (Ghost) --- */
@keyframes drop-off-screen {
    0% {
        transform: scale(1) translateY(0) rotate(0deg);
        opacity: 1;
    }
    20% {
        /* Zoom in slightly */
        transform: scale(1.1) translateY(-30px) rotate(2deg);
        opacity: 1;
    }
    100% {
        /* Drop down and fade out */
        transform: scale(0.5) translateY(80vh) rotate(-10deg);
        opacity: 0;
    }
}

.flying-art {
    position: fixed;
    z-index: 9999; /* Top level so it flies over everything */
    pointer-events: none;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    /* 1.2s matches the wait time in JS roughly */
    animation: drop-off-screen 1.2s forwards cubic-bezier(0.55, 0.085, 0.68, 0.53);
    transform-origin: center;
}

#game {
    width: 24vw;
    height: 65vh;
    min-width: 300px;
    min-height: 500px;
    max-width: 24vw;
    max-height: 65vh;
    top: 10vh;
    left: 50vw;
    background: #f0f0f0;
    font-family: 'Creato Display', sans-serif;
}

#game-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    padding: 2vh;
    width: 90%;
}

.game-hud {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2vh;
    font-size: 2.5vh;
    font-weight: bold;
    color: #333;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.hud-item span:first-child {
    font-size: 1.2vh;
    opacity: 0.6;
}

/* The Grid */
#game-grid {
    width: 100%;
    aspect-ratio: 1/1; /* Keeps it square */
    background: #fff;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 4px;
    padding: 4px;
    border-radius: 4px;
}

/* The Tiles */
.tile {
    width: 100%;
    height: 100%;
    border-radius: 50%; /* Circles/Shapes */
    cursor: pointer;
    transition: transform 0.2s ease-in-out, opacity 0.2s;
    z-index: 1; 
}

.tile:hover {
    transform: scale(0.9);
}

.tile.selected {
    border: 3px solid #000;
    transform: scale(0.8);
}

.tile.moving {
    z-index: 10;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px) rotate(-5deg); }
    50% { transform: translateX(5px) rotate(5deg); }
    75% { transform: translateX(-5px) rotate(-5deg); }
    100% { transform: translateX(0); }
}

.tile.shake {
    animation: shake 0.3s ease-in-out;
    border-color: red !important; /* Visual feedback */
}

/* Shapes based on Type (0-4) */
.tile[data-type="0"] { background: #000; border-radius: 50%; } /* Black Circle */
.tile[data-type="1"] { background: #888; border-radius: 0%; }  /* Grey Square */
.tile[data-type="2"] { background: #ccc; border-radius: 50% 50% 0 0; } /* Light Semicircle */
.tile[data-type="3"] { background: #333; clip-path: polygon(50% 0%, 0% 100%, 100% 100%); } /* Triangle */
.tile[data-type="4"] { background: transparent; border: 4px solid #000; box-sizing: border-box; } /* Ring */

/* Overlays */
#game-overlay, #submit-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    text-align: center;
}

#game-overlay.hidden, #submit-overlay.hidden {
    display: none;
}

#leaderboard-list {
    margin-top: 20px;
    width: 80%;
    font-size: 1.5vh;
    text-align: left;
}

.score-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #ddd;
    padding: 4px 0;
}

#platformer {
    min-width: 600px;
    min-height: 400px;
    width: 40vw;
    height: 50vh;
    top: 15vh;
    left: 20vw;
    background-color: #222;
}

#plat-canvas {
    image-rendering: pixelated; /* Keeps the pixel art look sharp */
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
}

#plat-time-container.danger {
    color: #ff4444;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}