:root {
  --desktop: #008689;
  --paper: #f4f4ee;
  --window: #c0c0c0;
  --window-light: #ffffff;
  --window-mid: #dfdfdf;
  --window-dark: #808080;
  --window-black: #000000;
  --title: #050085;
  --note: #fff4a8;
  --accent: #d84f6a;
  --ink: #111111;
}

* {
  box-sizing: border-box;
}

::-webkit-scrollbar-button {
  background-repeat: no-repeat;
  background-position: center;
}

::-webkit-scrollbar-button:vertical:start:increment,
::-webkit-scrollbar-button:vertical:end:decrement,
::-webkit-scrollbar-button:horizontal:start:increment,
::-webkit-scrollbar-button:horizontal:end:decrement {
  display: none;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--desktop);
  color: var(--ink);
  font-family: Tahoma, Verdana, Arial, sans-serif;
  font-size: 13px;
  overflow-x: hidden;
  padding-bottom: 46px;
}

.press-start-2p-regular {
  font-family: "Press Start 2P", system-ui !important;
  font-weight: 400;
  font-style: normal;
}

.title-bar,
.window,
button,
input,
label,
legend,
select,
textarea {
  font-family: Tahoma, Verdana, Arial, sans-serif;
}

button {
  font: inherit;
}

.desktop-shell {
  width: min(1180px, calc(100vw - 32px));
  min-height: calc(100vh - 46px);
  margin: 0 auto;
  padding: 34px 0 30px;
  position: relative;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 96px;
  padding: 0 250px 0 160px;
}

/* .site-header h1 {
  margin: 0;
  font-family: Arial, Tahoma, sans-serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-shadow: 2px 2px 0 var(--window-light);
} */

.site-header .press-start-2p-regular {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-shadow: 5px 2px 0px #bcbcbc;
}

.mini-logo {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto;
  background: transparent;
}

.mini-logo__image {
  width: 100%;
  height: 100%;
  grid-area: 1 / 1;
  display: block;
  object-fit: contain;
  image-rendering: auto;
}

.mini-logo__image--fast {
  opacity: 0;
}

.mini-logo:hover .mini-logo__image--idle,
.mini-logo:focus-visible .mini-logo__image--idle {
  opacity: 0;
}

.mini-logo:hover .mini-logo__image--fast,
.mini-logo:focus-visible .mini-logo__image--fast {
  opacity: 1;
}

.sticky-note {
  width: 200px;
  min-height: 120px;
  position: absolute;
  top: 18px;
  right: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--note);
  border: 2px solid var(--window-black);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.18);
  transform: rotate(1deg);
  font-family: "Comic Sans MS", "Comic Neue", "MS Sans Serif", sans-serif;
}

.sticky-note::before {
  content: "";
  width: 62px;
  height: 18px;
  position: absolute;
  top: -10px;
  left: 22px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(0, 0, 0, 0.22);
  transform: rotate(-6deg);
}

.sticky-note p {
  margin: 0;
  font-family: "Comic Sans MS", "Comic Neue", "MS Sans Serif", sans-serif;
  font-size: 1rem;
  line-height: 1.25;
}

.main-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 50vh;
}
.main-content .window {
  width: 20rem;
}

.library-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(300px, 1.04fr);
  grid-template-rows: 230px 330px;
  gap: 28px 34px;
  margin-top: 30px;
}

.library-window {
  height: 100%;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.library-window--tall {
  grid-row: 1 / span 2;
}

.window {
  filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.16));
}

.title-bar {
  min-height: 22px;
}

.title-bar-text {
  font-size: 0.95rem;
  padding-left: 0.5rem;
}

.folder-view {
  flex: 1;
  height: auto;
  min-height: 0;
  margin: 8px;
  padding: 18px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  grid-auto-rows: min-content;
  align-content: start;
  gap: 0.5rem;
  overflow: auto;
  background: var(--paper);
}

.library-item {
  min-height: 0;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 5px;
  color: var(--ink);
  text-shadow: none;
  background: transparent;
  border: 1px dotted transparent;
  box-shadow: none;
  cursor: pointer;
}

.library-item:hover,
.library-item:focus-visible,
.library-item.is-selected {
  outline: none;
  color: var(--window-light);
  text-shadow: none;
  background: var(--title);
  border-color: var(--paper);
  box-shadow: none;
}

.item-thumb {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid;
  border-color: var(--window-light) var(--window-dark) var(--window-dark) var(--window-light);
  box-shadow: 1px 1px 0 var(--window-black);
}

.item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: auto;
}

.item-thumb--icon {
  border: none;
  box-shadow: none;
}

.item-thumb--icon img {
  width: 48px;
  height: 48px;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  /* image-rendering: pixelated; */
}

.item-label {
  width: 100%;
  min-height: 35px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  text-align: center;
  font-size: 0.86rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.empty-folder {
  margin: 0;
  color: var(--window-dark);
  font-style: italic;
}

.detail-dialog {
  width: min(720px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 40px));
  margin: auto;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  overflow: visible;
}

.detail-dialog::backdrop {
  background:
    linear-gradient(rgba(0, 0, 0, 0.56), rgba(0, 0, 0, 0.56)),
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.08) 0,
      rgba(255, 255, 255, 0.08) 1px,
      transparent 1px,
      transparent 6px
    );
}

.detail-panel {
  width: 100%;
}

.detail-body {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 18px;
  max-height: calc(100vh - 110px);
  margin: 8px;
  padding: 16px;
  overflow: auto;
  background: var(--paper);
}

.detail-body .item-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--window-mid);
  border: 2px solid;
  border-color: var(--window-dark) var(--window-light) var(--window-light) var(--window-dark);
}

.detail-kicker {
  display: inline-block;
  margin: 0 0 8px;
  padding: 2px 7px;
  color: var(--window-light);
  background: var(--accent);
  border: 1px solid var(--window-black);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.detail-body h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  line-height: 1.15;
}

.detail-author {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--window-dark);
}

.detail-author a {
  color: var(--accent);
  text-decoration: none;
}

.detail-author a:hover,
.detail-author a:focus-visible {
  text-decoration: underline;
}

.detail-body p {
  line-height: 1.42;
}

.taskbar {
  height: 38px;
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  z-index: 10;
  background: var(--window);
  border-top: 2px solid var(--window-light);
  box-shadow: inset 0 2px 0 var(--window-mid);
}

.start-button,
.taskbar time,
.status-marquee {
  height: 28px;
  display: flex;
  align-items: center;
  background: var(--window);
  border: 2px solid;
  border-color: var(--window-light) var(--window-dark) var(--window-dark) var(--window-light);
  box-shadow: 1px 1px 0 var(--window-black);
}

.start-button {
  padding: 0 14px;
  font-weight: 700;
}

.taskbar time {
  min-width: 116px;
  justify-content: center;
  font-size: 0.85rem;
}

.taskbar-tray {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.lang-toggle {
  height: 28px;
  min-width: 0;
  padding: 0 10px;
  font-size: 0.85rem;
  cursor: pointer;
}

html[lang="en"] .lang-toggle [data-lang="en"],
html[lang="es"] .lang-toggle [data-lang="es"] {
  font-weight: 700;
}

.status-marquee {
  min-width: 0;
  overflow: hidden;
  border-color: var(--window-dark) var(--window-light) var(--window-light) var(--window-dark);
}

.status-marquee p {
  margin: 0;
  white-space: nowrap;
  animation: marquee 23s linear infinite;
}

@keyframes marquee {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(-100%);
  }
}

@media (max-width: 850px) {
  body {
    padding-bottom: 88px;
  }

  .desktop-shell {
    width: min(100% - 20px, 620px);
    padding-top: 18px;
  }

  .site-header {
    min-height: auto;
    justify-content: flex-start;
    padding: 0;
  }

  .site-header h1 {
    font-size: clamp(1.8rem, 9vw, 3rem);
  }

  .mini-logo {
    width: 58px;
    height: 58px;
  }

  .sticky-note {
    /* width: 100%; */
    min-height: 92px;
    position: relative;
    top: auto;
    right: auto;
    left: 25vw;
    margin: 18px 0 0;
    place-items: start;
  }

  .sticky-note--inline {
    left: auto;
  }

  .library-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 300px;
    grid-template-rows: none;
    gap: 22px;
    margin-top: 22px;
  }

  .library-window--tall {
    grid-row: auto;
  }

  .folder-view {
    max-height: none;
  }

  .detail-body {
    grid-template-columns: 96px 1fr;
  }

  .taskbar {
    height: auto;
    grid-template-columns: auto 1fr;
    grid-template-rows: 28px 28px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }

  .status-marquee {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 460px) {
  .desktop-shell {
    width: calc(100% - 12px);
  }

  .site-header {
    gap: 1.5rem;
    align-items: flex-start;
    padding-bottom: 1rem;
    padding-left: 1rem;
  }

  /* .site-header h1 {
    font-size: 1.9rem;
  } */
  .site-header .press-start-2p-regular {
    font-size: 1.9rem;
  }

  .folder-view {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 8px;
    padding: 14px 8px;
  }

  .item-thumb {
    width: 58px;
    height: 58px;
  }

  .item-label {
    font-size: 0.78rem;
  }

  .detail-body {
    grid-template-columns: 1fr;
  }

  .taskbar time {
    min-width: 88px;
  }

  .main-content .window-body {
    font-size: medium;
  }
}
