/* magsapp — desktop estilo XP */

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

html, body { height: 100%; }

body {
  margin: 0;
  font-family: Tahoma, Verdana, "Segoe UI", sans-serif;
  font-size: 14px;
  color: #000;
  background: #245EDC;
}

button { font: inherit; color: inherit; }
a { color: #0B4FC8; }
a:hover { color: #0A2C8A; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Área de trabalho ---------- */

.desktop {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}
.desktop[data-wallpaper="colina"] {
  background:
    radial-gradient(ellipse 140% 55% at 35% 108%, #5FA83A 0 58%, #4A8F2A 62%, transparent 63%),
    linear-gradient(180deg, #2F6FD6 0%, #6FA8EC 45%, #BCDDF6 75%);
}
.desktop[data-wallpaper="azul"] {
  background: radial-gradient(ellipse 90% 70% at 50% 40%, #3F7FE0, #1E4FB8 70%, #143A93);
}
.desktop[data-wallpaper="rosa"] {
  background:
    radial-gradient(ellipse 140% 55% at 65% 108%, #C98FB0 0 58%, #B07396 62%, transparent 63%),
    linear-gradient(180deg, #302F3B 0%, #6E5A7A 50%, #E6C4D7 85%);
}

.icons {
  position: absolute;
  top: 20px; left: 14px; bottom: 56px;
  display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start;
  gap: 12px;
}

.icon {
  width: 100px; min-height: 92px;
  padding: 6px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: transparent; border: 0; border-radius: 4px;
  cursor: pointer;
}
.icon__label {
  padding: 1px 4px;
  color: #fff;
  font-size: 13px; line-height: 1.3; text-align: center;
  text-shadow: 1px 1px 2px rgba(0,0,0,.9);
}
.icon.is-selected .icon__label,
.icon:focus-visible .icon__label {
  background: #316AC5;
  text-shadow: none;
}
.icon:focus-visible { outline: 1px dotted #fff; }

/* ---------- Janelas ---------- */

.win {
  position: absolute;
  left: 50%;
  width: min(640px, calc(100% - 24px));
  transform: translateX(calc(-50% + var(--dx, 0px)));
  top: var(--top, 40px);
  padding: 0 3px 3px;
  border-radius: 8px 8px 0 0;
  background: #7A96DF;
  box-shadow: 4px 6px 18px rgba(0,0,0,.35);
}
.win.is-active { background: #0831D9; }

.win__bar {
  height: 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 5px 0 10px;
  border-radius: 7px 7px 0 0;
  color: #fff; font-weight: 700;
  text-shadow: 1px 1px 0 rgba(10,30,136,.8);
  background: linear-gradient(180deg, #A9C4F5 0%, #7A9DE8 12%, #7493E0 50%, #8BA8E8 90%, #6E88D6 100%);
  cursor: default;
  user-select: none;
}
.win.is-active .win__bar {
  background: linear-gradient(180deg, #0997FF 0%, #0053EE 10%, #0050EE 45%, #0066FF 88%, #005BFF 94%, #003DD7 100%);
}
.win__title {
  display: flex; align-items: center; gap: 7px;
  min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.win__close {
  width: 24px; height: 24px; flex-shrink: 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #fff; border-radius: 4px;
  background: linear-gradient(180deg, #E8826A, #D9441E 60%, #C23812);
  cursor: pointer;
}
.win__close path { stroke: #fff; stroke-width: 2.4; stroke-linecap: round; }
.win__close:hover { filter: brightness(1.12); }

.win__menu {
  display: flex; gap: 14px;
  padding: 4px 8px;
  background: #ECE9D8;
  border-bottom: 1px solid #C7C3B0;
  font-size: 13px;
}

.win__body {
  display: flex; flex-wrap: wrap;
  min-height: 340px;
  background: #fff;
}
.win__side {
  flex: 1 1 170px; max-width: 100%;
  padding: 14px 12px;
  display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(180deg, #7BA2E7, #6375D6);
}
.win__content {
  flex: 999 1 360px; min-width: 0;
  padding: 22px;
  display: flex; flex-direction: column;
}
.win__status {
  padding: 4px 8px;
  background: #ECE9D8;
  border-top: 1px solid #C7C3B0;
  font-size: 12px; color: #333;
}

.panel { border-radius: 4px 4px 0 0; overflow: hidden; background: #D6DFF7; }
.panel__head {
  padding: 6px 10px;
  background: linear-gradient(90deg, #fff, #C6D3F7);
  color: #215DC6; font-weight: 700; font-size: 13px;
}
.panel__list { padding: 8px 6px; display: flex; flex-direction: column; gap: 2px; }
.panel__list button {
  min-height: 32px; padding: 0 6px;
  display: flex; align-items: center; gap: 6px;
  background: transparent; border: 0;
  color: #0B3CA8; font-size: 13px; text-align: left;
  cursor: pointer;
}
.panel__list button:hover { text-decoration: underline; }

/* ---------- Conteúdo ---------- */

.muted { color: #555; font-size: 13px; }

.welcome {
  flex-grow: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; text-align: center;
}
.welcome img { width: 100%; max-width: 280px; height: auto; display: block; }
.welcome__lead { margin: 0; max-width: 400px; font-size: 17px; line-height: 1.5; }
.welcome .muted { margin: 0; }

.project { display: flex; flex-direction: column; gap: 16px; }
.project p { margin: 0; font-size: 16px; line-height: 1.5; }
.project__logo {
  height: 170px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; border: 1px solid;
}
.project__logo img { display: block; max-width: 90%; height: auto; }
.project__logo--fin    { height: 150px; background: #E9F2EA; border-color: #B9C9BC; }
.project__logo--cocina { background: #F7F0E1; border-color: #D9CCAE; }
.project__logo--cocina img { height: 140px; width: auto; }
.project__logo--games  { background: #F4E6EE; border-color: #D8BFCD; }
.project__logo--games img { width: 240px; }
.project__actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px;
}
.project__actions .muted { margin-right: auto; }

.wordmark { display: flex; flex-direction: column; line-height: 1; }
.wordmark__top { font-family: monospace; font-size: 22px; color: #B07396; }
.wordmark__name { font-size: 46px; font-weight: 900; color: #302F3B; letter-spacing: -1.5px; }

.xp-btn {
  min-height: 34px; padding: 0 16px;
  display: inline-flex; align-items: center;
  border: 1px solid #003C74; border-radius: 3px;
  background: linear-gradient(180deg, #fff, #ECEBE6 80%, #D6D0C5);
  color: #000; text-decoration: none;
}
.xp-btn:hover { box-shadow: inset 0 0 0 2px #F8B636; color: #000; }

.notepad { font-family: "Lucida Console", "Courier New", monospace; font-size: 15px; line-height: 1.65; }
.notepad p { margin: 0 0 14px; }
.notepad p:last-child { margin-bottom: 0; }

/* ---------- Barra de tarefas ---------- */

.taskbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  height: 40px;
  display: flex; align-items: stretch;
  background: linear-gradient(180deg, #3F8CF3 0%, #245EDC 12%, #245EDC 88%, #1941A5 100%);
}
.start {
  padding: 0 26px 0 18px;
  border: 0; border-radius: 0 12px 12px 0;
  background: linear-gradient(180deg, #5EB75E 0%, #3C9A3C 15%, #379237 80%, #2C7B2C 100%);
  box-shadow: inset -2px 0 4px rgba(0,0,0,.3);
  color: #fff; font-size: 18px; font-weight: 700; font-style: italic;
  text-shadow: 1px 1px 1px rgba(0,0,0,.5);
  cursor: pointer;
}
.start:hover { filter: brightness(1.08); }
.tasks {
  flex-grow: 1; min-width: 0;
  padding: 4px 8px;
  display: flex; align-items: center; gap: 4px;
  overflow: hidden;
}
.task {
  height: 30px; width: 170px; min-width: 0; flex-shrink: 1;
  padding: 0 10px;
  border: 0; border-radius: 3px;
  background: linear-gradient(180deg, #5C9AF5, #3C81F3);
  box-shadow: inset -1px -1px 0 rgba(0,0,0,.25), inset 1px 1px 0 rgba(255,255,255,.3);
  color: #fff; font-size: 13px; text-align: left;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  cursor: pointer;
}
.task.is-active { background: #1E52C9; box-shadow: inset 1px 1px 2px rgba(0,0,0,.45); }
.tray {
  padding: 0 16px;
  display: flex; align-items: center;
  background: linear-gradient(180deg, #1290E9, #0F7FDB 50%, #0C6BC9);
  border-left: 1px solid #0A3FA8;
  box-shadow: inset 1px 0 0 #3BA7F5;
  color: #fff; font-size: 13px;
}

/* ---------- Celular ---------- */

@media (max-width: 720px) {
  .icons {
    position: static;
    padding: 12px 8px 0;
    flex-direction: row; flex-wrap: wrap; justify-content: center;
  }
  .icon { width: 86px; min-height: 84px; }
  .win {
    position: fixed;
    top: 8px !important;
    left: 8px; right: 8px; width: auto;
    transform: none;
    max-height: calc(100dvh - 56px);
    overflow: auto;
  }
  .win__side { display: none; }
  .task { width: 120px; }
}

@media (prefers-reduced-motion: no-preference) {
  .win { animation: pop .12s ease-out; }
  @keyframes pop { from { opacity: .4; } to { opacity: 1; } }
}
