* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 20%, #ffffff30 0, #ffffff00 40%),
    radial-gradient(circle at 80% 75%, #89b4ff22 0, #89b4ff00 45%),
    linear-gradient(160deg, #1e4ea8 0%, #3873d4 35%, #2a5ebc 70%, #214f9f 100%);
}

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #0a2f76, #061a44);
  color: #fff;
}

.boot-screen.hidden {
  display: none;
}

.boot-panel {
  width: min(460px, 90vw);
  border: 1px solid #5f8ad0;
  background: #0e3f97;
  padding: 16px;
  text-align: center;
}

.boot-panel h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

.boot-logo {
  width: 180px;
  max-width: 80%;
  height: auto;
  margin-bottom: 8px;
}

.boot-panel p {
  margin: 0 0 12px;
  font-size: 14px;
}

.boot-bar {
  height: 20px;
  border: 1px solid #8fb7f3;
  background: #07337f;
  margin-bottom: 10px;
}

.boot-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(180deg, #8dd2ff, #4f9df2);
}

body.has-photo-wallpaper {
  background:
    linear-gradient(#00000033, #00000033),
    var(--photo-wallpaper),
    linear-gradient(160deg, #1e4ea8 0%, #3873d4 35%, #2a5ebc 70%, #214f9f 100%);
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-position: center center, center center, center center;
  background-size: cover, cover, cover;
  background-attachment: fixed, fixed, fixed;
}

.desktop {
  width: 100%;
  min-height: 100vh;
  padding: 12px 12px 56px;
  position: relative;
  overflow-x: hidden;
}

.desktop-icons {
  position: absolute;
  top: 12px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.icon-item {
  width: 90px;
  border: 0;
  background: transparent;
  color: #fff;
  text-shadow: none;
  cursor: pointer;
  text-align: center;
  padding: 4px;
  font-family: Tahoma, Verdana, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.15;
  -webkit-font-smoothing: auto;
  text-rendering: auto;
}

.icon-item span {
  display: block;
  font-size: 22px;
  margin-bottom: 3px;
  text-shadow: 1px 1px 2px #00317b;
}

.icon-item:hover {
  background: #ffffff22;
}

.window {
  position: relative;
  margin-left: 104px;
  margin-bottom: 10px;
  width: calc(100% - 116px);
  max-width: none;
}

.window:not(.maximized) {
  max-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
}

.window:not(.maximized) .window-content {
  min-height: 0;
  overflow: auto;
}

.window.maximized {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 40px;
  width: 100%;
  margin: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
}

.window.maximized .window-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

body.window-maximized .desktop-icons {
  display: none;
}

.window.minimized,
.window.closed {
  display: none;
}

.menu-bar {
  display: flex;
  gap: 2px;
  padding: 3px 6px;
  border-top: 1px solid #ffffff;
  border-bottom: 1px solid #a7a58f;
  background: linear-gradient(180deg, #fdfcf7, #ece9d8);
  font-size: 12px;
}

.menu-bar span {
  padding: 1px 8px;
  border: 1px solid transparent;
}

.menu-bar span:hover {
  border-color: #7f9db9;
  background: #dbe9ff;
}

.window-content {
  padding: 10px;
}

.strudel-window {
  min-height: 520px;
}

.strudel-content {
  display: grid;
  gap: 8px;
  height: 100%;
}

#strudelFrame {
  width: 100%;
  min-height: 62vh;
  height: 62vh;
  border: 1px solid #7f9db9;
  background: #fff;
}

.window.maximized .strudel-content {
  height: 100%;
}

.window.maximized #strudelFrame {
  height: 100%;
  min-height: 0;
}

.intro-window h1 {
  margin: 0 0 4px;
  font-size: clamp(22px, 3vw, 34px);
  color: #113c88;
}

.subtitle,
.welcome,
.status,
.note,
.help-text,
li,
.taskbar {
  font-size: 13px;
}

.subtitle {
  margin: 0 0 5px;
  color: #274d8d;
}

.welcome {
  margin: 0;
}

.hero-buttons {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status {
  min-height: 18px;
  margin: 6px 0 0;
  color: #274d8d;
}

.note {
  margin: 6px 0 0;
}

.explorer-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.main-gallery-panel {
  margin: 0;
  width: 100%;
  border: 1px solid #a2b4cc;
  background: #fff;
  padding: 8px;
}

.facts-list {
  margin: 8px 0 0;
  padding-left: 18px;
}

.facts-list li {
  margin: 0;
}

.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.friend-card {
  border: 1px solid #7f9db9;
  background: #fff;
  padding: 6px;
}

.friend-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid #7f9db9;
  display: block;
}

.friend-name {
  margin: 5px 0 2px;
  font-weight: 700;
  color: #113c88;
  font-size: 12px;
}

.friend-status {
  margin: 0;
  font-size: 11px;
}

.guestbook-form {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.guestbook-list {
  display: grid;
  gap: 6px;
}

.guestbook-status {
  margin: 0 0 8px;
  font-size: 12px;
  color: #2d5ca9;
  min-height: 14px;
}

.guestbook-entry {
  border: 1px solid #7f9db9;
  background: #f0e0d6;
  padding: 6px;
}

.guestbook-meta {
  margin: 0 0 4px;
  font-size: 11px;
  color: #0f0c5d;
  font-family: "Courier New", monospace;
}

.guestbook-text {
  margin: 0;
  font-size: 12px;
  white-space: pre-wrap;
}

.guestbook-image {
  display: block;
  margin: 4px 0;
  max-width: min(220px, 100%);
  height: auto;
  border: 1px solid #7f9db9;
  background: #fff;
}

.guestbook-reactions {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.guestbook-reaction {
  border: 1px solid #7f9db9;
  background: linear-gradient(180deg, #fff6ef, #ead7ca);
  font-size: 11px;
  padding: 1px 6px;
  cursor: pointer;
}

.guestbook-reaction:disabled {
  opacity: 0.7;
  cursor: default;
}

.help-text {
  margin: 0 0 8px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 6px;
}

.gallery-hint {
  margin: 0 0 6px;
  font-size: 11px;
  color: #3a5b8f;
}

.photo-card {
  margin: 0;
  border: 1px solid #7f9db9;
  background: #fff;
  padding: 4px;
}

.photo-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid #7f9db9;
  display: block;
}

.photo-card figcaption {
  margin-top: 4px;
  text-align: center;
  font-size: 11px;
  display: none;
}

.empty-gallery {
  grid-column: 1 / -1;
  border: 1px dashed #7f9db9;
  padding: 10px;
  background: #f6fbff;
}

.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  background: linear-gradient(180deg, #3f88f1, #245ec2 35%, #1e4ea7);
  border-top: 1px solid #7cb0f5;
  box-shadow: inset 0 1px 0 #8ec4ff;
  z-index: 5000;
}

.start-btn {
  height: 100%;
  min-width: 106px;
  color: #fff;
  border-radius: 0 10px 10px 0;
  border: 1px solid #1c5f14;
  border-left: 0;
  font-style: italic;
  font-weight: 700;
  font-size: 20px;
  text-transform: lowercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px 0 12px;
  background: linear-gradient(180deg, #7ad25f, #4ea233 45%, #2d7e1f);
  box-shadow: inset 0 1px 0 #bdf7aa, inset -1px 0 0 #5cc243;
}

.start-logo {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: inline-block;
}

.task-btn {
  color: #fff;
  border: 1px solid #5f8ad0;
  background: linear-gradient(180deg, #4e7fc9, #2f5ba1);
  padding: 6px 12px;
  min-height: 30px;
  min-width: 148px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.task-btn.task-hidden {
  display: none;
}

.task-btn.active {
  background: linear-gradient(180deg, #4676bf, #2e5a9e);
  border-color: #3b66ab;
  box-shadow: inset 0 1px 0 #6e9de0;
}

.task-btn.minimized {
  opacity: 0.88;
  background: linear-gradient(180deg, #5a7fb8, #3f5f94);
}

.task-icon {
  font-size: 14px;
  line-height: 1;
  flex: 0 0 auto;
}

.tray {
  margin-left: auto;
  color: #fff;
  border: 1px solid #6f99d9;
  background: linear-gradient(180deg, #5e94db, #3d74c0);
  height: 100%;
  min-width: 106px;
  padding: 0 14px;
  border-radius: 10px 0 0 10px;
  border-right: 1px solid #6f99d9;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: italic;
  font-weight: 700;
  font-size: 20px;
  text-transform: lowercase;
  box-shadow: inset 0 1px 0 #8dc0ff, inset 1px 0 0 #7eaee9;
}

.start-menu {
  position: fixed;
  left: 0;
  bottom: 40px;
  width: min(360px, 94vw);
  border: 1px solid #2450a0;
  box-shadow: 0 6px 16px #00000055;
  z-index: 5100;
}

.start-menu.hidden {
  display: none;
}

.start-menu-header {
  padding: 7px 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(180deg, #4b8ef1, #2458bd);
}

.start-menu-body {
  padding: 10px;
  background: #f1eadc;
  display: grid;
  gap: 8px;
}

.start-hero {
  margin: 0;
  font-family: Tahoma, Verdana, "Segoe UI", sans-serif;
  font-size: 24px;
  line-height: 1;
  color: #11408f;
  text-shadow: 1px 1px 0 #ffffff;
}

.start-menu-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #24477f;
}

#randomJanFact {
  color: #1f3a67;
}

.extra-sparkle {
  position: fixed;
  top: -20px;
  animation: fall 1.8s linear forwards;
  z-index: 10;
  pointer-events: none;
}

.photo-viewer {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #00000073;
  z-index: 4000;
  padding: 16px;
}

.photo-viewer.hidden {
  display: none;
}

.menu-nope {
  position: fixed;
  right: 16px;
  bottom: 52px;
  z-index: 5200;
}

.menu-nope.hidden {
  display: none;
}

.menu-nope-window {
  margin: 0;
  width: 150px;
}

.viewer-window {
  margin: 0;
  width: min(960px, 95vw);
  max-height: 90vh;
}

.viewer-body {
  display: grid;
  gap: 8px;
}

#viewerImage {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border: 1px solid #7f9db9;
  background: #fff;
}

#viewerVideo {
  width: 100%;
  max-height: 72vh;
  border: 1px solid #7f9db9;
  background: #000;
}

#viewerImage.hidden,
#viewerVideo.hidden {
  display: none;
}

#viewerCaption {
  margin: 0;
  font-size: 12px;
  color: #23457a;
}

.photo-card {
  cursor: pointer;
}

.photo-card.video-card {
  display: grid;
  gap: 4px;
}

.video-thumb {
  aspect-ratio: 1 / 1;
  border: 1px solid #7f9db9;
  background: linear-gradient(145deg, #1a2f57, #0d1729);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  text-align: center;
  padding: 8px;
}

@keyframes fall {
  to {
    transform: translateY(105vh) rotate(360deg);
    opacity: 0;
  }
}

@media (max-width: 980px) {
  .window {
    margin-left: 0;
    width: 100%;
  }

  .desktop-icons {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    position: relative;
    top: 0;
    left: 0;
    margin-bottom: 10px;
  }

  .icon-item {
    width: auto;
    padding: 8px;
  }

  .explorer-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .desktop {
    padding: 8px 8px 52px;
  }

  .task-btn {
    display: flex;
    max-width: 120px;
    font-size: 10px;
    padding: 4px 8px;
  }

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  #strudelFrame {
    min-height: 70vh;
  }

  body.has-photo-wallpaper {
    background-attachment: scroll, scroll, scroll;
  }
}

.load-more-btn {
  display: block;
  margin: 20px auto;
  padding: 12px 24px;
  font-size: 14px;
  font-family: Tahoma, Verdana, sans-serif;
  color: #003366;
  background: linear-gradient(180deg, #f0f0f0, #d4d0c8);
  border: 1px solid #7f9db9;
  border-radius: 3px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 #fff;
}

.load-more-btn:hover {
  background: linear-gradient(180deg, #e8e8e0, #c8c4bc);
}
