/* Jiksah OS: Windows XP styling and responsive layout. */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #76b9f2 url("windowsxp.jpg") center center / cover no-repeat fixed;
  color: #111;
  font-family: Tahoma, Verdana, sans-serif;
}

main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.window {
  width: min(100%, 920px);
  border: 3px solid #0755d9;
  border-radius: 8px 8px 3px 3px;
  background: #dce5f5;
  box-shadow: 4px 8px 24px #0007;
  overflow: hidden;
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 5px 5px 8px;
  color: white;
  font-size: 14px;
  font-weight: bold;
  background: linear-gradient(#5a9bff 0%, #0864ef 18%, #0054e5 75%, #2078f8);
}

.window-buttons {
  margin-left: auto;
  display: flex;
  gap: 3px;
}

.window-buttons span {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 1px solid white;
  border-radius: 3px;
  background: linear-gradient(#77b2ff,#1760d8);
}

.window-buttons span:last-child {
  background: linear-gradient(#f99b79,#d83113);
}

.menu {
  background: #ece9d8;
  padding: 5px 7px;
  font-size: 12px;
  word-spacing: 12px;
  border-bottom: 1px solid #9a9a9a;
}

.top-strip {
  text-align: right;
  padding: 7px;
  background: linear-gradient(#f7faff,#8a9ed3 45%,#536baf 90%);
}

.mode {
  display: inline-block;
  min-width: 190px;
  text-align: left;
  padding: 4px 9px;
  font-size: 12px;
  background: linear-gradient(white,#c4d3ee);
  border: 1px solid #7f95c0;
  border-radius: 5px;
}

.layout {
  display: grid;
  grid-template-columns: 130px minmax(0,1fr) 220px;
  min-height: 400px;
}

.left {
  background: linear-gradient(100deg,#e8effb,#aabde3);
  border-right: 1px solid #829ac8;
  padding: 10px 6px;
}

.nav {
  font-size: 12px;
  font-weight: bold;
  color: #223356;
  padding: 10px 6px;
  border-bottom: 1px solid #b8c9e6;
}

.nav:first-child {
  background: #dbe9fa;
  border: 1px solid #9ab3d5;
}

.center {
  background: black;
  color: white;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 6px;
}

.media-header {
  font-family: "Comic Sans MS","Comic Sans","Comic Neue",cursive;
  text-align: center;
}

h1 {
  margin: 5px;
  font-size: clamp(24px,4vw,34px);
}

.visual {
  display: grid;
  place-items: center;
  flex: 1;
  background: white;
  margin: 4px;
  min-height: 270px;
}

.character {
  display: block;
  max-width: 100%;
  width: 320px;
  max-height: 46vh;
  object-fit: contain;
}

.tagline {
  font: 16px "Comic Sans MS","Comic Sans","Comic Neue",cursive;
  margin: 8px;
}

.right {
  background: #364475;
  color: white;
  padding: 0 7px 12px;
  min-width: 0;
}

.right-tab {
  background: #6176bb;
  padding: 8px;
  text-align: center;
  font-size: 12px;
  margin: 0 -7px 10px;
}

.album {
  margin: 10px auto;
  display: grid;
  place-items: center;
  color: #bcc6e4;
  background: linear-gradient(135deg,#26304e,#4c5b87);
  width: 105px;
  height: 105px;
  font-size: 62px;
  text-shadow: 3px 4px #1a2344;
}

.track {
  font-size: 13px;
  color: #d6ff43;
  overflow-wrap: anywhere;
  padding: 6px;
  background: #1a213a;
}

.song {
  display: block;
  width: 100%;
  text-align: left;
  padding: 5px 3px;
  border: 0;
  background: transparent;
  color: white;
  font: 12px Tahoma,sans-serif;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.song.active {
  background: #000;
  color: #caff35;
}

#status {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.readout {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 9px;
  background: #111827;
  color: #d6ff43;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.transport {
  background: linear-gradient(#f8fbff,#a8b9dc 45%,#eff5ff 60%,#8196bf);
  padding: 8px 12px 12px;
}

#seek {
  width: 100%;
  margin: 2px 0 9px;
}

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.controls button {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  border: 1px solid #708bb4;
  color: #234d85;
  background: radial-gradient(circle at 35% 25%,white 10%,#e0edfb 50%,#9eb4d5 100%);
  box-shadow: inset 0 0 2px white, 0 1px 2px #4562;
  font-size: 15px;
  cursor: pointer;
}

#play {
  width: 40px;
  height: 40px;
}

.controls button:active {
  background: #a5badb;
}

input[type=range] {
  accent-color: #5aab36;
  cursor: pointer;
  min-width: 0;
}

#volume {
  width: 90px;
}

.spacer {
  flex: 1;
}

.repeat {
  color: #29456e;
  font-size: 11px;
}

button:focus-visible,input:focus-visible {
  outline: 2px solid #0060df;
  outline-offset: 2px;
}

@media (max-width:700px) {
  main {
    padding: 8px;
  }
  .layout {
    grid-template-columns: minmax(0,1fr) 160px;
    min-height: 0;
  }
  .left {
    display: none;
  }
}

@media (max-width:460px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .album {
    display: none;
  }
  .visual {
    min-height: 0;
  }
  .right {
    padding-bottom: 6px;
  }
  .repeat {
    display: none;
  }
  .spacer {
    display: none;
  }
}

/* XP desktop layout */
[hidden] {
  display: none !important;
}

body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

main {
  height: calc(100% - 43px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 12px 8px;
  gap: 12px;
}

.pinned-player {
  width: min(100%, 620px);
  flex: none;
}

.player-label {
  margin-left: auto;
  font-size: 11px;
}

.track {
  font-size: 15px;
}

.transport {
  padding: 5px 10px 8px;
}

#status {
  margin: 4px 0 0;
  color: #243b62;
}

.controls #shuffle {
  width: auto;
  border-radius: 5px;
  padding: 0 9px;
  font: bold 12px "Comic Sans MS", "Comic Neue", cursive;
}

.controls #shuffle.active {
  background: #e6b800;
  color: #111;
  border-color: #947000;
  box-shadow: inset 0 1px 4px #0005;
}

.workspace {
  flex: 1;
  min-height: 0;
  width: min(100%, 920px);
  position: relative;
  overflow: auto;
  display: grid;
  place-items: center;
}

.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  font-family: "Comic Sans MS", "Comic Sans", "Comic Neue", cursive;
  padding: 8px;
}

.home h1 {
  color: white;
  text-shadow: 2px 2px 4px black;
}

.home .character {
  max-height: min(42vh, 340px);
  width: auto;
  max-width: 100%;
}

.home .tagline {
  background: white;
  padding: 10px 16px;
  border: 1px solid #aaa;
  border-radius: 6px;
  color: #111;
}

.page-window {
  align-self: start;
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: #ece9d8;
}

.page-body {
  flex: 1;
  padding: 22px;
  margin: 5px;
  background: white;
  border: 1px inset #aaa;
  font-family: "Comic Sans MS", "Comic Sans", "Comic Neue", cursive;
}

.page-body h2 {
  margin-top: 0;
}

.page-body .song {
  color: #17356d;
  background: #e5edfa;
  margin-bottom: 3px;
  padding: 9px;
}

.page-body .song.active {
  background: #164db1;
  color: white;
}

.window-buttons button {
  width: 23px;
  height: 23px;
  color: white;
  border: 1px solid white;
  border-radius: 3px;
  background: linear-gradient(#77b2ff,#1760d8);
  cursor: pointer;
  font-weight: bold;
}

#close-page {
  background: linear-gradient(#f99b79,#d83113);
}

.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 43px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(#4c96f6 0%,#2059d8 18%,#245adc 87%,#143ca4);
  box-shadow: inset 0 2px 2px #8fc4ff;
  padding: 4px 0;
  font: 12px Tahoma, sans-serif;
}

#home-button {
  align-self: stretch;
  border: 0;
  border-radius: 0 12px 12px 0;
  padding: 0 14px;
  background: linear-gradient(#66af50,#348b26 55%,#236c1c);
  color: white;
  font: bold italic 17px Tahoma,sans-serif;
  cursor: pointer;
  text-shadow: 1px 1px #245b1b;
}

.task-buttons {
  display: flex;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.task-buttons button {
  flex: 1 0 54px;
  max-width: 130px;
  height: 30px;
  text-align: left;
  padding: 0 9px;
  border: 1px solid #1545b1;
  border-radius: 3px;
  color: white;
  background: linear-gradient(#5598ed,#3877d9);
  box-shadow: inset 1px 1px #8abafa;
  cursor: pointer;
  font: 12px Tahoma,sans-serif;
}

.task-buttons button[aria-pressed="true"] {
  background: #174bbb;
  box-shadow: inset 1px 2px 4px #0d307c;
}

#clock {
  align-self: stretch;
  display: grid;
  place-items: center;
  padding: 0 10px;
  color: white;
  background: linear-gradient(#32b6f0,#128cdb);
  border-left: 1px solid #1268b0;
  white-space: nowrap;
}

@media (max-width:480px) {
  main {
    padding: 6px;
    gap: 6px;
  }
  .controls {
    gap: 5px;
  }
  #volume {
    width: 62px;
  }
  .page-body {
    padding: 12px;
  }
  #home-button {
    padding: 0 7px;
    font-size: 13px;
  }
  #clock {
    padding: 0 5px;
  }
  .home .character {
    max-height: 30vh;
  }
}

/* Side-by-side XP desktop: music stays visible while pages scroll. */
@media (min-width: 761px) {
  main {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: start;
    gap: 16px;
    padding: 16px;
  }
  .pinned-player {
    width: 100%;
    align-self: start;
  }
  .workspace {
    width: 100%;
    height: 100%;
    min-width: 0;
    align-self: stretch;
  }
  .page-window {
    width: 100%;
    min-height: 100%;
  }
  .home .character {
    max-height: min(55vh, 460px);
  }
  .controls {
    gap: 7px;
  }
  .controls .spacer {
    display: none;
  }
}

@media (max-width: 760px) {
  .pinned-player {
    width: min(100%, 620px);
  }
  .workspace {
    width: 100%;
  }
}

/* XP page scrolling and responsive About artwork */
.workspace {
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
}

.workspace:has(.page-window:not([hidden])) {
  overflow: hidden;
}

.page-window {
  height: 100%;
  min-height: 0;
  min-width: 0;
}

.page-window .titlebar {
  flex-shrink: 0;
}

.page-body {
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  scrollbar-color: #91aee0 #e8eefb;
}

.page-body::-webkit-scrollbar {
  width: 17px;
}

.page-body::-webkit-scrollbar-track {
  background: #e8eefb;
  border-left: 1px solid #9aafd2;
}

.page-body::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg,#e9f2ff,#91aee0);
  border: 1px solid #6688bd;
  border-radius: 3px;
}

.page-body::-webkit-scrollbar-thumb:hover {
  background: #779bd6;
}

.about-picture {
  display: block;
  width: auto;
  max-width: min(100%, 48vw);
  max-height: 58vh;
  height: auto;
  object-fit: contain;
  margin: 20px auto;
  border: 2px solid #0054e3;
  border-radius: 5px;
}

@media (max-width: 760px) {
  .about-picture {
    max-width: 100%;
    max-height: 48vh;
  }
}

/* Independent desktop windows and dynamic taskbar */
.workspace, .workspace:has(.page-window:not([hidden])) { overflow: hidden; display: block; isolation: isolate; }
.home { height: 100%; justify-content: center; padding: 8px 8px 8px 105px; overflow: auto; }
.desktop-shortcuts { position: absolute; top: 8px; left: 4px; display: flex; flex-direction: column; gap: 6px; z-index: 1; }
.shortcut { width: 88px; min-height: 66px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: white; background: transparent; border: 1px solid transparent; text-shadow: 1px 1px 3px black; font: 12px Tahoma,sans-serif; cursor: pointer; }
.shortcut-icon { font-size: 34px; line-height: 1.2; filter: drop-shadow(1px 2px 1px #0006); }
.shortcut img { width: 40px; height: 40px; object-fit: contain; }
.shortcut:hover, .shortcut:focus-visible { background: #0054e366; border: 1px dotted white; }
.window-layer { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.app-window { position: absolute; left: 100px; top: var(--offset); width: calc(100% - 100px - var(--offset)); height: calc(100% - var(--offset)); min-height: 0; pointer-events: auto; }
.app-window .titlebar { background: linear-gradient(#92a9ce,#5574a5); }
.app-window[data-active="true"] .titlebar { background: linear-gradient(#5a9bff 0%, #0864ef 18%, #0054e5 75%, #2078f8); }
.window-buttons [data-action="close"] { background: linear-gradient(#f99b79,#d83113); }
.taskbar { z-index: 100; }
.task-buttons button { flex: 0 0 auto; min-width: 70px; max-width: 145px; }
@media (max-width: 760px) {
 .desktop-shortcuts { top: 0; left: 0; right: 0; flex-direction: row; justify-content: space-around; gap: 0; }
 .shortcut { width: 19%; min-height: 54px; font-size: 11px; }
 .shortcut-icon { font-size: 26px; }
 .shortcut img { width: 30px; height: 30px; }
 .home { padding: 62px 4px 4px; }
 .window-layer { top: 58px; }
 .app-window { inset: 0; width: 100%; height: 100%; }
}

/* Sidebar shortcuts and full-size application workspace */
.desktop-sidebar { display: flex; flex-direction: column; align-items: stretch; gap: 16px; min-width: 0; min-height: 0; width: 100%; }
.desktop-sidebar .pinned-player { width: 100%; flex: none; }
.desktop-sidebar .desktop-shortcuts { position: static; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 4px; z-index: auto; width: 100%; }
.desktop-sidebar .shortcut { width: 100%; min-width: 0; min-height: 78px; padding: 5px 2px; }
.desktop-sidebar .shortcut img { width: 48px; height: 48px; object-fit: contain; }
.home { padding: 8px; }
.window-layer { inset: 0; }
.app-window { inset: 0; width: 100%; height: 100%; }
@media (min-width: 761px) {
  .desktop-sidebar { align-self: stretch; overflow-y: auto; }
}
@media (max-width: 760px) {
  .desktop-sidebar { width: min(100%, 620px); flex: none; gap: 5px; }
  .desktop-sidebar .desktop-shortcuts { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }
  .desktop-sidebar .shortcut { min-height: 50px; gap: 2px; }
  .desktop-sidebar .shortcut img { width: 32px; height: 32px; }
  .workspace { flex: 1; min-height: 140px; }
  main { overflow-y: auto; }
}
