html,
body {
  margin: 0;
  height: 100%;
  background-color: #050507;
  font-family: 'Open Sans', sans-serif;
  overflow: hidden;
}

body {
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

/* Preloader discreto e minimalista exibido apenas até fontes e background inicial carregarem */
#app-preloader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050507;
  opacity: 1;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

#app-preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: rgba(255, 255, 255, 0.78);
  animation: dodo-preloader-spin 0.8s linear infinite;
}

@keyframes dodo-preloader-spin {
  to {
    transform: rotate(360deg);
  }
}

* {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

body::selection {
  background: transparent;
}

.center {
  display: flex;
  justify-content: center;
  padding: clamp(16px, 3.2vh, 38px) 16px clamp(8px, 1.5vh, 18px);
  color: white;
  font-size: clamp(2.1rem, 4.2vw, 4rem);
  line-height: 1.1;
  text-shadow: 0 0 10px #fff, 0 0 20px rgb(255, 255, 255);
}

.drag {
  width: 40%;
}

.center:hover {
  cursor: default;
}

.center-app {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  justify-content: center;
  gap: clamp(8px, 1.6vw, 20px);
  width: 100%;
  flex: 1 1 auto;
  padding: clamp(12px, 2.2vw, 28px);
  box-sizing: border-box;
}

#desktop {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%);

  display: flex;
  flex-direction: column;
  width: clamp(300px, 54vw, 820px);
  min-height: fit-content;
  max-height: calc(100dvh - 104px);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow-y: auto;
}

.window {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
  width: 75vh;
  height: 65vh;
  min-width: 320px;
  min-height: 240px;
  background: rgba(34, 34, 38, 0.72);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 4px 30px #00000026;
  backdrop-filter: blur(14px);
  border-radius: 10px;
  overflow: hidden;
  contain: layout style;
}

.window.is-focused {
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 10px 38px rgba(0, 0, 0, 0.35);
}

.window.is-interacting {
  will-change: transform;
}

.window.is-animating {
  will-change: transform, opacity;
}

.window.is-maximized {
  border-radius: 0;
}

.window-bar {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

.title-bar {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  padding: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 45px;
  font-size: 1.5em;
  border-top-right-radius: 9px;
  border-top-left-radius: 9px;
}

.window-bar .title-bar {
  background: none;
  cursor: move;
  flex: 1;
  min-width: 0;
  height: 36px;
  border-radius: 0;
}

.title-bar span {
  padding-left: 5px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.window-bar button {
  background-color: transparent;
  border: none;
  color: white;
  font-size: 0.95em;
  font-weight: bold;
  cursor: pointer;
  padding: 7px 14px;
  border-radius: 4px;
  transition: background-color 0.15s ease;
}

.window-bar button.win-btn-close {
  padding: 7px 22px;
}

.window-bar button:hover {
  background-color: rgba(255, 255, 255, 0.16);
}

.window-bar button.win-btn-close:hover {
  background-color: #ff112459;
  border-radius: 4px;
}

.window .content {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: clamp(8px, 2cqi, 18px);
  box-sizing: border-box;
  container-type: size;
  container-name: win-body;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

/* Handles de redimensionamento discretos */
.resize-handle {
  position: absolute;
  z-index: 5;
}

.window.is-maximized .resize-handle {
  display: none;
}

.resize-n { top: 0; left: 8px; right: 8px; height: 6px; cursor: ns-resize; }
.resize-s { bottom: 0; left: 8px; right: 8px; height: 6px; cursor: ns-resize; }
.resize-e { top: 8px; bottom: 8px; right: 0; width: 6px; cursor: ew-resize; }
.resize-w { top: 8px; bottom: 8px; left: 0; width: 6px; cursor: ew-resize; }
.resize-ne { top: 0; right: 0; width: 12px; height: 12px; cursor: nesw-resize; }
.resize-nw { top: 0; left: 0; width: 12px; height: 12px; cursor: nwse-resize; }
.resize-se { bottom: 0; right: 0; width: 12px; height: 12px; cursor: nwse-resize; }
.resize-sw { bottom: 0; left: 0; width: 12px; height: 12px; cursor: nesw-resize; }

/* Barra de tarefas para alternar/restaurar janelas abertas e minimizadas */
#window-taskbar {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 14px;
  background: rgba(30, 30, 34, 0.68);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.34);
  max-width: calc(100vw - 20px);
  overflow: visible;
  box-sizing: border-box;
}

#window-taskbar[hidden] {
  display: none;
}

.taskbar-track {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100vw - 38px);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.taskbar-track::-webkit-scrollbar {
  display: none;
}

.taskbar-item {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 6px 6px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease, opacity 0.16s ease, box-shadow 0.16s ease;
}

.taskbar-item:hover,
.taskbar-item:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  outline: none;
}

.taskbar-item:active {
  transform: scale(0.94);
}

.taskbar-item.is-active {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.44);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 2px 10px rgba(0, 0, 0, 0.24);
}

.taskbar-item.is-minimized {
  opacity: 0.62;
  background: rgba(255, 255, 255, 0.03);
}

.taskbar-item.is-minimized:hover,
.taskbar-item.is-minimized:focus-visible {
  opacity: 0.92;
  background: rgba(255, 255, 255, 0.15);
}

.taskbar-item img {
  display: block;
  width: 26px;
  height: 26px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  pointer-events: none;
  flex-shrink: 0;
}

.taskbar-item i {
  font-size: 1.1rem;
  pointer-events: none;
}

.taskbar-indicator {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  pointer-events: none;
  transition: width 0.18s ease, background-color 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

.taskbar-item.is-active .taskbar-indicator {
  width: 18px;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.55);
}

.taskbar-item.is-minimized .taskbar-indicator {
  width: 5px;
  opacity: 0.45;
  background: rgba(255, 255, 255, 0.48);
}

.taskbar-tooltip.tooltip-text {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, 4px);
  background: #111;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.42);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 20;
}

.taskbar-tooltip.tooltip-text.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* Notificação não-bloqueante no lugar de alert() */
#desktop-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translate(-50%, -16px);
  z-index: 1000;
  background: rgba(25, 25, 25, 0.85);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.95rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#desktop-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.icon {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  width: clamp(92px, 11vw, 150px);
  min-height: clamp(96px, 11.5vw, 152px);
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 1.2vw, 16px) 8px;
  margin: 0;
  border-radius: 6px;
  box-sizing: border-box;
  transition: transform 0.2s, background-color 0.2s;
}

.icon:hover {
  background-color: rgba(255, 255, 255, 0.176);
  backdrop-filter: blur(4px);
  border-radius: 6px;
  cursor: pointer;
}

.icon img {
  display: block;
  width: clamp(44px, 4.8vw, 75px);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  flex-shrink: 0;
}

.icon-label {
  margin-top: 10px;
  font-size: clamp(0.85rem, 1.1vw, 1rem);
  line-height: 1.2;
  text-align: center;
  color: white;
  text-shadow: 1px 1px 2px black;
  pointer-events: none;
}

/*animação do fundo*/

.star {
  position: absolute;
  width: 20px;
  height: 2px;
  background: white;
  animation-name: animate;
  animation-duration: 10s;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}

.star::before {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 300px;
  height: 1px;
  background: linear-gradient(90deg, #fff, transparent);
}

@keyframes animate {
  0% {
    transform: rotate(315deg) translateX(0);
    opacity: 1;
  }

  20% {
    transform: rotate(315deg) translateX(-1000px);
    opacity: 0;
  }

  100% {
    transform: rotate(315deg) translateX(-1000px);
    opacity: 0;
  }
}

.star:nth-child(1) {
  top: 10%;
  right: 0;
  animation-delay: 0s;
}

.star:nth-child(2) {
  top: -60%;
  right: 50%;
  animation-delay: 1s;
}

.star:nth-child(3) {
  top: -60%;
  right: 0;
  animation-delay: 2s;
}

.star:nth-child(4) {
  top: -20%;
  right: 40%;
  animation-delay: 2s;
}

.star:nth-child(5) {
  top: -28%;
  right: -20;
  animation-delay: 9s;
}

@media (max-width: 1580px) {
  .title-bar {
    font-size: 1.05rem;
    height: 38px;
  }
}

@media (max-width: 1200px) {
  #desktop {
    width: clamp(320px, 68vw, 740px);
  }

  .window {
    width: 70vw;
    height: 70vh;
  }
}

@media (max-width: 780px), (max-width: 960px) and (max-height: 500px) {
  .center {
    font-size: clamp(1.85rem, 7vw, 2.5rem);
    padding: 16px 12px 8px;
  }

  .window {
    width: calc(100vw - 12px);
    height: calc(100dvh - 76px);
    left: 6px !important;
    top: 6px !important;
    min-width: 0;
    min-height: 0;
    max-width: calc(100vw - 12px);
    max-height: calc(100dvh - 76px);
    border-radius: 14px;
  }

  .window-bar {
    padding: 6px 8px;
    gap: 6px;
  }

  .window-bar button {
    min-width: 40px;
    min-height: 38px;
    padding: 8px 12px;
  }

  .window-bar button.win-btn-close {
    padding: 8px 16px;
  }

  .win-btn-maximize,
  .resize-handle {
    display: none;
  }

  .window .content {
    flex: 1 1 0%;
    min-height: 0;
    padding: 10px;
    font-size: 1rem;
    -webkit-overflow-scrolling: touch;
  }

  .title-bar {
    height: auto;
    min-height: 40px;
    font-size: 1.08rem;
    padding: 4px 6px;
  }

  #desktop {
    width: min(94vw, 520px);
    max-height: calc(100dvh - 104px);
    top: 50%;
    transform: translate(-50%, -48%);
  }

  .center-app {
    gap: 10px;
    padding: 12px 10px 18px;
  }

  .icon {
    width: clamp(88px, 32vw, 130px);
    min-height: 94px;
  }

  .icon img {
    width: 48px;
    height: auto;
  }

  #window-taskbar {
    bottom: 8px;
    padding: 4px 6px;
  }

  .taskbar-track {
    gap: 4px;
  }
}

@media (max-width: 420px) {
  .window {
    width: calc(100vw - 8px);
    height: calc(100dvh - 74px);
    left: 4px !important;
    top: 4px !important;
    max-width: calc(100vw - 8px);
    max-height: calc(100dvh - 74px);
    border-radius: 12px;
  }

  .window .content {
    padding: 8px;
  }
}

@media (max-width: 960px) and (max-height: 500px) {
  #desktop {
    width: min(92vw, 680px);
    max-height: calc(100dvh - 82px);
  }

  .center {
    padding: 10px 12px 4px;
    font-size: clamp(1.5rem, 4vw, 2rem);
  }

  .center-app {
    gap: 8px;
    padding: 8px 10px 12px;
  }

  .icon {
    width: clamp(82px, 18vw, 120px);
    min-height: 84px;
    padding: 8px 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #app-preloader,
  .taskbar-item,
  .taskbar-indicator,
  .taskbar-tooltip.tooltip-text {
    transition: none;
  }

  .preloader-spinner {
    animation: none;
    border-color: rgba(255, 255, 255, 0.45);
  }
}
