*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #e9e1c8;
}

/* Loading Screen */

#loading-screen {
  position: fixed;
  inset: 0;
  background: #f7f1df;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-panel {
  width: 90vw;
  max-width: 360px;
  background: #fffdf4;
  border: 3px solid #333;
  box-shadow: 0 4px 0 #a88c52;
  padding: 16px 18px;
}

.loading-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: #2b1d10;
  margin-bottom: 4px;
}

.loading-subtitle {
  font-size: 0.85rem;
  color: #5a4324;
  margin-bottom: 12px;
}

.loading-bar {
  width: 100%;
  height: 18px;
  border: 2px solid #2b1d10;
  background: #f1e6c7;
  position: relative;
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(
    -45deg,
    #f6b653,
    #f6b653 8px,
    #fce0a4 8px,
    #fce0a4 16px
  );
  transition: width 0.2s linear;
}

.loading-status {
  margin-top: 8px;
  font-size: 0.8rem;
  color: #4b3820;
}

/* Overlay / Disclaimer */

.hidden {
  display: none !important;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.overlay-window {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 90vw;
  max-width: 360px;
  transform: translate(-50%, -50%);
  background: #fffdf4;
  border: 3px solid #111;
  box-shadow: 0 4px 0 #764f18;
  display: flex;
  flex-direction: column;
}

.overlay-titlebar {
  background: linear-gradient(#f6c76f, #f1a63c);
  padding: 6px 10px;
  border-bottom: 2px solid #8b5a1f;
}

.overlay-title {
  font-weight: 700;
  color: #2b1907;
  font-size: 0.9rem;
}

.overlay-body {
  padding: 10px;
  background: #fffdf4;
}

.overlay-main-text {
  font-size: 0.85rem;
  line-height: 1.3;
  color: #3a2914;
}

.overlay-footer {
  padding: 8px 10px;
  display: flex;
  justify-content: flex-end;
  border-top: 2px solid #e4c48c;
  background: #f7e1b4;
}

/* Desktop */

#desktop {
  position: fixed;
  inset: 0;
  background: url("/paper school.webp") center/cover no-repeat;
  display: flex;
  flex-direction: column;
}

.desktop-icons {
  flex: 1;
  padding: 10px 10px 40px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 10px;
}

.desktop-icon {
  width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.desktop-icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 4px;
}

.desktop-icon span {
  font-size: 0.7rem;
  text-align: center;
  color: #1d140b;
  text-shadow: 0 1px 0 #f4e6c4;
}

/* Taskbar */

#taskbar {
  position: relative;
  height: 40px;
  background: url("white-paper-texture-view-white-crumpled-paper_759200-2473.jpg")
    center/cover no-repeat;
  border-top: 2px solid #b89a63;
  display: flex;
  align-items: center;
  padding: 0 6px;
}

.taskbar-left,
.taskbar-center,
.taskbar-right {
  display: flex;
  align-items: center;
}

.taskbar-left {
  flex: 0 0 auto;
}

.taskbar-center {
  flex: 1;
  justify-content: center;
}

.taskbar-right {
  flex: 0 0 auto;
  justify-content: flex-end;
}

.start-button img {
  height: 30px;
  object-fit: contain;
}

.taskbar-label {
  font-size: 0.75rem;
  padding: 3px 6px;
  background: rgba(255, 253, 244, 0.7);
  border: 1px solid #9f7b3a;
  border-radius: 3px;
  color: #2b1d10;
}

/* Windows */

.window {
  position: absolute;
  top: 15%;
  left: 10%;
  width: 80vw;
  max-width: 380px;
  min-height: 180px;
  background: #fffdf4;
  border: 3px solid #222;
  box-shadow: 0 4px 0 #7e5a22;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.window-titlebar {
  background: linear-gradient(#fcd88b, #f6b653);
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: move;
}

.window-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #2a1703;
}

.window-controls {
  display: flex;
  gap: 4px;
}

.window-btn {
  width: 20px;
  height: 20px;
  border: 2px solid #2b1907;
  background: #ffe9bc;
  color: #2b1907;
  font-size: 0.8rem;
  padding: 0;
}

.window-btn:active {
  background: #f4c478;
}

.window-body {
  flex: 1;
  display: flex;
  background: repeating-linear-gradient(
    0deg,
    #fffdf4,
    #fffdf4 18px,
    #f5e6bf 18px,
    #f5e6bf 19px
  );
}

/* Music window */

.music-body {
  flex-direction: column;
  padding: 8px;
}

.music-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.music-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  margin-right: 8px;
}

.music-now-playing .label {
  font-size: 0.7rem;
  color: #4a3212;
}

.music-now-playing .title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1f1204;
}

.music-playlist {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 8px;
  border: 2px solid #c99a4c;
  background: rgba(255, 252, 240, 0.8);
}

.music-track {
  width: 100%;
  padding: 6px 8px;
  text-align: left;
  font-size: 0.8rem;
  border-bottom: 1px solid #e5c582;
  background: transparent;
  color: #2b1d10;
}

.music-track.active {
  background: #f6d289;
}

.music-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* Documents window */

.docs-body {
  padding: 0;
}

.docs-sidebar {
  width: 38%;
  border-right: 2px solid #c99a4c;
  background: #fbe7b7;
  display: flex;
  flex-direction: column;
}

.docs-content {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
}

.docs-item {
  border: 0;
  border-bottom: 1px solid #e3c279;
  padding: 6px;
  font-size: 0.8rem;
  text-align: left;
  background: transparent;
  color: #2b1d10;
}

.docs-item.active {
  background: #f6d289;
}

.doc-page {
  display: none;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #211407;
}

.doc-page.active {
  display: block;
}

/* Buttons */

button {
  font-family: inherit;
  cursor: pointer;
}

.btn-primary {
  min-width: 70px;
  padding: 6px 10px;
  font-size: 0.8rem;
  border-radius: 3px;
  border: 2px solid #2a1703;
  background: #f6b653;
  color: #2a1703;
}

.btn-primary:active {
  background: #e49a30;
}

.btn-secondary {
  min-width: 55px;
  padding: 4px 6px;
  font-size: 0.8rem;
  border-radius: 3px;
  border: 2px solid #3a2511;
  background: #ffe9bc;
  color: #2a1703;
}

.btn-secondary:active {
  background: #f4c478;
}

/* Desktop icon card using paper texture instead of separate art files */
.icon-card {
  width: 48px;
  height: 48px;
  border: 1px solid #e5c582;
  background-image: url("white-paper-texture-view-white-crumpled-paper_759200-2473.jpg");
  background-size: cover;
  background-position: center;
  border-radius: 4px;
  box-shadow: 0 2px 0 rgba(0,0,0,0.08) inset;
}

/* small visual variants for different apps (simple overlay glyphs done with gradients) */
.icon-music { background-blend-mode: multiply; }
.icon-docs { background-blend-mode: multiply; }
.icon-kill { background-blend-mode: multiply; }
.icon-paint { background-blend-mode: multiply; }

.start-user-row {
  display: flex;
  align-items: center;
}

.start-user-info {
  flex: 1;
}

/* Start menu should sit above the taskbar and animate up */
#start-menu {
  position: absolute;
  bottom: 44px;
  left: 8px;
  width: 220px;
  z-index: 800;
  transition: transform 160ms ease, opacity 160ms ease;
  transform-origin: left bottom;
}

/* Start menu panel with paper texture */
.start-panel {
  border: 2px solid #b08942;
  background-image: url("white-paper-texture-view-white-crumpled-paper_759200-2473.jpg");
  background-size: cover;
  background-position: center;
  box-shadow: 0 3px 0 #7c5a25;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Layout for apps area inside Start menu */
.start-apps {
  border-top: 1px solid #d3b26e;
  padding-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Textured button inside Start menu that shows the paper texture */
.start-paper-swatch {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  border: 2px solid #8d6a2e;
  background-image: url("white-paper-texture-view-white-crumpled-paper_759200-2473.jpg");
  background-size: cover;
  background-position: center;
  box-shadow: 0 1px 0 rgba(0,0,0,0.2);
  padding: 0;
}
.start-paper-swatch:active {
  transform: translateY(1px);
  box-shadow: 0 0 0 rgba(0,0,0,0.2);
}
#start-menu.hidden {
  opacity: 0;
  transform: translateY(8px) scaleY(0.98);
  pointer-events: none;
}
#start-menu:not(.hidden) {
  opacity: 1;
  transform: translateY(0) scaleY(1);
}

/* Kill video card visual */
.kill-video-card {
  width: 120px;
  height: 80px;
  border-radius: 4px;
  border: 1px solid #c99a4c;
  background-image: url("white-paper-texture-view-white-crumpled-paper_759200-2473.jpg");
  background-size: cover;
  background-position: center;
}

/* Overlay button for video: hidden visually and non-interactive per request */
#kill-video-overlay {
  min-width: 160px;
  min-height: 40px;
  font-weight: 700;
  opacity: 0 !important;
  color: transparent !important;
  background: transparent !important;
  border: none !important;
  pointer-events: none !important;
}

/* Mobile friendly tweaks */

@media (max-width: 480px) {
  .window {
    width: 90vw;
    left: 5vw;
  }
}