/*
 * Creative Desktop bridge
 *
 * The OS63 React desktop and Maridian's eight applications now share one
 * document and one desktop runtime. This layer contains launchers and app
 * windows only; there is no second wallpaper, menu bar, widget system or dock.
 */
html,
body.os-page {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #111;
}

body.os-page > .os-root {
  position: fixed;
  inset: 0;
  z-index: 40;
  min-height: 0;
  overflow: visible;
  pointer-events: none;
  background: transparent;
}

.os-root .os-desktop,
.os-root .os-desktop[hidden] {
  display: block !important;
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.os-root .os-icons {
  position: fixed;
  top: 52px;
  right: 22px;
  bottom: auto;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(2, 94px);
  grid-auto-rows: 112px;
  gap: 8px 6px;
  align-content: start;
  justify-items: center;
  pointer-events: auto;
}

.os-root .os-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 94px;
  min-height: 108px;
  padding: 6px 3px;
  gap: 4px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: transparent;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .8), 0 0 12px rgba(0, 0, 0, .32);
  font: inherit;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.os-root .os-icon:hover,
.os-root .os-icon:focus-visible,
.os-root .os-icon.is-selected {
  background: rgba(255, 255, 255, .18);
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}

.os-root .os-icon .icon-art {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
}

.os-root .os-icon .icon-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .36));
}

.os-root .os-icon .icon-label {
  display: block;
  width: 100%;
  color: #fff;
  font: 600 11px/1.18 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  text-align: center;
  opacity: 1;
}

.os-root .os-icon .cs-lock-badge {
  width: 22px;
  height: 22px;
}

.os-root .app-modal,
.os-root .case-writeup,
.os-root .ios-lightbox {
  pointer-events: none;
}

.os-root .app-modal.open,
.os-root .case-writeup.open,
.os-root .ios-lightbox.open {
  display: flex;
}

.os-root .app-modal.open > *,
.os-root .case-writeup.open > *,
.os-root .ios-lightbox.open > * {
  pointer-events: auto;
}

.os-root .app-modal {
  z-index: 100 !important;
}

.os-root .case-writeup,
.os-root .ios-lightbox {
  z-index: 500 !important;
}

@media (max-width: 720px) {
  .os-root .os-icons {
    top: auto;
    right: 10px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 10px;
    display: flex;
    gap: 2px;
    padding: 7px 8px 6px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: 17px;
    background: rgba(25, 26, 31, .48);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .34);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    scrollbar-width: none;
  }

  .os-root .os-icons::-webkit-scrollbar { display: none; }

  .os-root .os-icon {
    flex: 0 0 70px;
    width: 70px;
    min-height: 72px;
    padding: 2px;
  }

  .os-root .os-icon .icon-art {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .os-root .os-icon .icon-label {
    overflow: hidden;
    font-size: 9px;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .os-root .app-modal.open > * {
    top: 44px !important;
    right: 8px !important;
    bottom: 94px !important;
    left: 8px !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .os-root .os-icon,
  .os-root .os-icon .icon-art img {
    animation: none !important;
    transition: none !important;
  }
}
