/* =========================================================
   PORTAFOLIO — ESCRITORIO
   Estética de sistema operativo de los 90: marcos biselados,
   barra de tareas y ventanas que se arrastran.

   El biselado no usa `border: outset` (cada navegador lo pinta
   distinto): se hace con cuatro box-shadow interiores, que dan
   el mismo resultado en todas partes.
   ========================================================= */

:root {
  /* Gris del chrome, como en aquellos sistemas */
  --face: #c6c6c6;
  --face-dark: #9a9a9a;
  --light: #ffffff;
  --shadow: #808080;
  --dark: #1b1b1b;

  --title-a: #7a0f0f;          /* barra de título activa */
  --title-b: #d63a3a;
  --title-off-a: #6b6b6b;      /* barra de título inactiva */
  --title-off-b: #a5a5a5;

  --accent: #fa4040;
  --ink: #101010;
  --ink-soft: #4a4a4a;
  --paper: #ffffff;

  --taskbar-h: 40px;

  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, "Roboto Mono",
    Menlo, Monaco, "Courier New", monospace;
  --font-display: "Silkscreen", "Courier New", var(--font-mono);
}

/* Biselado hacia fuera (botones, ventanas, barra) */
.bevel,
.win,
.tb-btn,
.tray,
.taskbar,
.btn,
.start-menu {
  box-shadow:
    inset 1px 1px 0 0 var(--light),
    inset -1px -1px 0 0 var(--dark),
    inset 2px 2px 0 0 var(--face),
    inset -2px -2px 0 0 var(--shadow);
}

/* Biselado hacia dentro (campos, zonas hundidas) */
.bevel-in,
.input,
.admin-list,
.win-body.sunken {
  box-shadow:
    inset 1px 1px 0 0 var(--shadow),
    inset -1px -1px 0 0 var(--light),
    inset 2px 2px 0 0 var(--dark),
    inset -2px -2px 0 0 var(--face);
}

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

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;              /* el escritorio no hace scroll; las ventanas sí */
  font-family: var(--font-mono);
  color: var(--ink);
  background: #000;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }

.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;
}

/* =========================================================
   ESCRITORIO
   ========================================================= */
.desktop {
  position: fixed;
  inset: 0 0 var(--taskbar-h) 0;
  background: #000;              /* JS lo sustituye con config.wallpaper */
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

/* ----- Iconos ----- */
.icon-grid {
  position: absolute;
  inset: 0;
  padding: 1rem 0.5rem;
  display: grid;
  /* Se llenan de arriba abajo y luego saltan de columna, como un
     escritorio de verdad. Hacen falta filas explícitas: con solo
     grid-auto-flow:column cada icono se iría a su propia columna. */
  grid-template-rows: repeat(auto-fill, 96px);
  grid-auto-columns: 96px;
  grid-auto-flow: column;
  gap: 0.25rem;
  justify-content: start;
  z-index: 2;
}
/* En pantallas bajas o estrechas, en filas para que no se salgan */
@media (max-width: 700px), (max-height: 620px) {
  .icon-grid {
    grid-template-rows: none;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    grid-auto-rows: 92px;
    grid-auto-flow: row;
    align-content: start;
  }
}

.d-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  padding: 0.4rem 0.25rem;
  background: none;
  border: 1px dotted transparent;
  cursor: pointer;
  text-align: center;
  color: #fff;
  font-size: 0.72rem;
  line-height: 1.25;
  word-break: break-word;
}
.d-icon:hover .d-icon-img { filter: brightness(1.15); }
.d-icon:focus-visible { outline: none; border-color: #fff; }
/* Azul de selección clásico para el icono abierto o enfocado */
.d-icon.is-open .d-icon-label,
.d-icon:focus-visible .d-icon-label {
  background: #000080;
  color: #fff;
  text-shadow: none;
}
.d-icon-img { width: 40px; height: 40px; flex-shrink: 0; }
.d-icon-img svg {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;   /* los iconos son de píxeles: sin suavizado */
}
.d-icon-label {
  padding: 1px 3px;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.85);
}

/* =========================================================
   VENTANAS
   ========================================================= */
.windows { position: absolute; inset: 0; z-index: 3; pointer-events: none; }

.win {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 260px;
  min-height: 140px;
  padding: 3px;
  background: var(--face);
  pointer-events: auto;
  animation: winIn 0.14s ease-out;
}
@keyframes winIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}
.win.is-min { display: none; }
.win.is-max {
  inset: 0 0 0 0 !important;
  width: auto !important;
  height: auto !important;
}

/* ----- Barra de título: plateada, con icono a la izquierda ----- */
.win-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 3px 3px 3px 4px;
  background: linear-gradient(90deg, #9a9a9a, #d2d2d2);
  color: #3a3a3a;
  cursor: inherit;
  user-select: none;
  touch-action: none;            /* para poder arrastrar en móvil */
}
.win.is-active .win-bar {
  background: linear-gradient(90deg, #5c5c5c, #cfcfcf);
  color: #000;
}
.win-ico { width: 16px; height: 16px; flex-shrink: 0; }
.win-ico svg { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.win-title {
  flex: 1;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.win-controls { display: flex; gap: 2px; }
.win-btn {
  width: 20px;
  height: 18px;
  display: grid;
  place-items: center;
  background: var(--face);
  border: 0;
  color: var(--ink);
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  box-shadow:
    inset 1px 1px 0 0 var(--light),
    inset -1px -1px 0 0 var(--dark),
    inset 2px 2px 0 0 var(--face),
    inset -2px -2px 0 0 var(--shadow);
}
.win-btn:active {
  box-shadow:
    inset 1px 1px 0 0 var(--shadow),
    inset -1px -1px 0 0 var(--light),
    inset 2px 2px 0 0 var(--dark);
}

/* ----- Cuerpo (base; cada tipo lo cambia) ----- */
.win-body {
  flex: 1;
  overflow: auto;
  margin-top: 3px;
  padding: 0.9rem 1rem;
  background: var(--paper);
  font-size: 0.82rem;
  line-height: 1.6;
  box-shadow:
    inset 1px 1px 0 0 var(--shadow),
    inset -1px -1px 0 0 var(--light),
    inset 2px 2px 0 0 var(--dark);
}
.win-body p { margin: 0 0 0.8rem; }
.win-body a { color: #a01414; }
.muted { color: var(--ink-soft); }

/* ----- Barra de estado ----- */
.win-status {
  flex-shrink: 0;
  margin-top: 3px;
  padding: 2px 8px;
  min-height: 20px;
  font-size: 0.7rem;
  line-height: 16px;
  color: var(--ink);
  background: var(--face);
  box-shadow:
    inset 1px 1px 0 0 var(--shadow),
    inset -1px -1px 0 0 var(--light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================
   1) VISOR DE TEXTO  (.txt y ficha de proyecto)
   Fondo negro, monoespaciado, titular en rojo.
   ========================================================= */
.body-txt {
  background: #0b0b0b;
  color: #d8d8d8;
  padding: 1.1rem 1.2rem;
}
.body-txt .txt-head {
  margin: 0 0 1.1rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: #ff3b3b;
  letter-spacing: 0;
}
.body-txt .txt-body { white-space: pre-wrap; line-height: 1.9; }
.body-txt a { color: #ff8a8a; }

.body-repo .facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.9rem;
  margin: 1.2rem 0;
  font-size: 0.78rem;
}
.body-repo dt { color: #8a8a8a; }
.body-repo dd { margin: 0; }
.body-repo .repo-links { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* =========================================================
   2) EXPLORADOR CON PESTAÑAS  (carpetas y Proyectos)
   ========================================================= */
.body-explorer {
  background: var(--face);
  padding: 4px 4px 0;
  display: flex;
  flex-direction: column;
  box-shadow: none;
}

.tabs-row {
  display: flex;
  gap: 2px;
  padding: 2px 2px 0;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.etab {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 3px 9px 4px;
  margin-bottom: -1px;
  background: var(--face-dark);
  border: 0;
  border-radius: 3px 3px 0 0;
  font-size: 0.72rem;
  cursor: pointer;
  box-shadow:
    inset 1px 1px 0 0 var(--light),
    inset -1px 0 0 0 var(--dark);
}
.etab.is-active {
  background: var(--face);
  font-weight: 700;
  padding-bottom: 6px;
  z-index: 1;
}
.etab-ico { width: 13px; height: 13px; flex-shrink: 0; }
.etab-ico svg { width: 100%; height: 100%; display: block; image-rendering: pixelated; }

.explorer-pane {
  flex: 1;
  overflow: auto;
  padding: 0.7rem;
  background: var(--paper);
  box-shadow:
    inset 1px 1px 0 0 var(--shadow),
    inset -1px -1px 0 0 var(--light),
    inset 2px 2px 0 0 var(--dark);
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.4rem;
  align-content: start;
}
.folder-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.2rem;
  background: none;
  border: 1px dotted transparent;
  cursor: pointer;
  font-size: 0.7rem;
  text-align: center;
  color: var(--ink);
  word-break: break-word;
}
.folder-item:hover { background: #e8e8f4; border-color: #9a9ab0; }
.folder-item:focus-visible { outline: none; background: #000080; color: #fff; }
.fi-ico { width: 32px; height: 32px; }
.fi-ico svg { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.folder-empty { color: var(--ink-soft); font-style: italic; padding: 0.5rem; }

/* =========================================================
   3) PANEL DE PROPIEDADES  (Habilidades)
   ========================================================= */
.body-props { background: var(--face); box-shadow: none; padding: 0.9rem; }
.body-props .group {
  margin: 0 0 0.9rem;
  padding: 0.6rem 0.8rem 0.7rem;
  border: 0;
  box-shadow:
    inset 1px 1px 0 0 var(--shadow),
    inset -1px -1px 0 0 var(--light);
}
.body-props legend { padding: 0 0.35rem; font-size: 0.75rem; font-weight: 700; }
/* Lista de componentes, estilo "programas instalados" */
.comp-list {
  padding: 3px;
  background: var(--paper);
  box-shadow:
    inset 1px 1px 0 0 var(--shadow),
    inset -1px -1px 0 0 var(--light),
    inset 2px 2px 0 0 var(--dark);
}
.comp-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 2px 4px;
  font-size: 0.75rem;
}
.comp-row:hover { background: #000080; color: #fff; }
.comp-mark { width: 14px; height: 14px; flex-shrink: 0; }
.comp-mark svg { width: 100%; height: 100%; display: block; image-rendering: pixelated; }

/* =========================================================
   4) VISTA DE LISTA  (Educación)
   ========================================================= */
.body-list { background: var(--paper); padding: 3px; }
.listview { width: 100%; border-collapse: collapse; font-size: 0.74rem; }
.listview th {
  position: sticky;
  top: 0;
  padding: 3px 7px;
  text-align: left;
  font-weight: 700;
  background: var(--face);
  box-shadow:
    inset 1px 1px 0 0 var(--light),
    inset -1px -1px 0 0 var(--shadow);
}
.listview td {
  padding: 5px 7px;
  border-bottom: 1px solid #e4e4e4;
  vertical-align: top;
}
.listview tr:hover td { background: #e8e8f4; }
.cell-ico {
  display: inline-block;
  width: 16px; height: 16px;
  margin-right: 0.4rem;
  vertical-align: -3px;
}
.cell-ico svg { width: 100%; height: 100%; display: block; image-rendering: pixelated; }

/* =========================================================
   5) ENTORNO DE RED  (Redes)
   ========================================================= */
.body-net { background: var(--face); box-shadow: none; padding: 4px; display: flex; }
.body-net .explorer-pane { flex: 1; }
.body-net .fi-ico { width: 40px; height: 40px; }

/* =========================================================
   6) CUADRO DE DIÁLOGO  (Contacto)
   ========================================================= */
.body-dialog { background: var(--face); box-shadow: none; padding: 1rem; }
.dlg-head {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.dlg-ico { width: 32px; height: 32px; flex-shrink: 0; }
.dlg-ico svg { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.dlg-head p { margin: 0; font-size: 0.76rem; }
.dlg-actions { display: flex; justify-content: flex-end; margin-top: 0.4rem; }

/* Tirador para redimensionar, abajo a la derecha */
.win-grip {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  touch-action: none;
  background: repeating-linear-gradient(
    135deg,
    transparent 0 2px,
    var(--light) 2px 3px,
    var(--shadow) 3px 4px
  );
}
.win.is-max .win-grip { display: none; }


/* =========================================================
   BOTONES Y CAMPOS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  background: var(--face);
  border: 0;
  color: var(--ink);
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn:active {
  box-shadow:
    inset 1px 1px 0 0 var(--shadow),
    inset -1px -1px 0 0 var(--light),
    inset 2px 2px 0 0 var(--dark);
}
.btn-ico { width: 14px; height: 14px; flex-shrink: 0; }
.btn-ico svg { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.btn-primary { font-weight: 700; color: #6d0d0d; }

.field { margin-bottom: 0.7rem; }
.field label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}
.input {
  width: 100%;
  padding: 0.35rem 0.5rem;
  background: var(--paper);
  border: 0;
  font-size: 0.8rem;
  font-family: var(--font-mono);
}
.input:focus { outline: 1px dotted var(--ink); outline-offset: -4px; }
textarea.input { resize: vertical; line-height: 1.5; }
.input.color { padding: 2px; height: 32px; cursor: pointer; }
select.input { cursor: pointer; }

.check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.6rem 0;
  font-size: 0.78rem;
  cursor: pointer;
}

/* Aviso bajo el botón de enviar del formulario */
.form-status {
  margin-top: 0.7rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.form-status[hidden] { display: none; }
.form-status.is-warn { color: #a01414; font-weight: 700; }

/* =========================================================
   BARRA DE TAREAS
   ========================================================= */
.taskbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--taskbar-h);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px;
  background: var(--face);
  z-index: 50;
}

.tb-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: 30px;
  padding: 0 0.6rem;
  max-width: 190px;
  background: var(--face);
  border: 0;
  color: var(--ink);
  font-size: 0.75rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.tb-btn > span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-btn:active,
.tb-btn.is-down {
  box-shadow:
    inset 1px 1px 0 0 var(--shadow),
    inset -1px -1px 0 0 var(--light),
    inset 2px 2px 0 0 var(--dark);
}

.start-btn { font-family: var(--font-display); font-size: 0.7rem; flex-shrink: 0; }
.start-logo {
  width: 16px; height: 16px; flex-shrink: 0;
  background:
    linear-gradient(135deg, var(--accent) 0%, var(--accent) 50%, #8a1414 50%, #8a1414 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.linkedin-btn { flex-shrink: 0; }
.linkedin-btn svg { width: 15px; height: 15px; color: #0a66c2; flex-shrink: 0; }

.task-buttons {
  flex: 1;
  display: flex;
  gap: 3px;
  overflow: hidden;
  min-width: 0;
}
.task-buttons .tb-btn { flex: 0 1 150px; min-width: 40px; }

.tray {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 30px;
  padding: 0 0.5rem;
  flex-shrink: 0;
  box-shadow:
    inset 1px 1px 0 0 var(--shadow),
    inset -1px -1px 0 0 var(--light);
}
.tray-btn {
  padding: 2px 5px;
  background: none;
  border: 0;
  cursor: pointer;
}
.tray-btn:hover .lang-code { color: #8a1414; }
.lang-code { font-family: var(--font-display); font-size: 0.62rem; }

.clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
  font-size: 0.68rem;
  cursor: inherit;
}
.clock-time { font-family: var(--font-display); font-size: 0.66rem; }
.clock-date { font-size: 0.58rem; color: var(--ink-soft); }

/* =========================================================
   MENÚ INICIO
   ========================================================= */
.start-menu {
  position: fixed;
  left: 4px;
  bottom: calc(var(--taskbar-h) + 2px);
  z-index: 60;
  display: flex;
  min-width: 240px;
  padding: 3px;
  background: var(--face);
}
.start-menu[hidden] { display: none; }

.start-side {
  width: 30px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--title-a), var(--title-b));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 0.8rem;
}
.start-side span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-display);
  font-size: 0.6rem;
  color: #fff;
}

.start-list { flex: 1; margin: 0; padding: 3px; list-style: none; }
.start-list li { display: block; }
.start-list button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.7rem;
  background: none;
  border: 0;
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}
.start-list button:hover { background: var(--title-a); color: #fff; }
.start-list button svg { width: 20px; height: 20px; flex-shrink: 0; }
.start-sep { height: 1px; margin: 4px 2px; background: var(--shadow); box-shadow: 0 1px 0 var(--light); }

/* =========================================================
   PORTAL DE ADMINISTRACIÓN
   ========================================================= */
.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.55);
}
.admin-overlay[hidden] { display: none; }

.admin-panel {
  position: relative;
  width: min(760px, 100%);
  max-height: min(88vh, 720px);
}
.admin-panel .win-bar { background: linear-gradient(90deg, var(--title-a), var(--title-b)); color: #fff; }
.admin-panel .win-body { max-height: calc(88vh - 40px); }

.admin-hint { font-size: 0.75rem; color: var(--ink-soft); }
.admin-error { min-height: 1.1rem; margin: 0.2rem 0 0.6rem; font-size: 0.75rem; color: #a01414; }

.tabs { display: flex; gap: 3px; margin-bottom: 0.8rem; }
.tab {
  padding: 0.35rem 0.8rem;
  background: var(--face-dark);
  border: 0;
  font-size: 0.75rem;
  cursor: pointer;
  box-shadow:
    inset 1px 1px 0 0 var(--light),
    inset -1px -1px 0 0 var(--dark);
}
.tab.is-active { background: var(--face); font-weight: 700; }

.admin-list {
  max-height: 260px;
  overflow: auto;
  padding: 0.35rem;
  margin-bottom: 0.7rem;
  background: var(--paper);
}
.admin-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem;
  font-size: 0.76rem;
  border-bottom: 1px solid #eee;
}
.admin-row:last-child { border-bottom: 0; }
.admin-row svg { width: 18px; height: 18px; flex-shrink: 0; }
.admin-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row .tagpill {
  padding: 0 5px;
  font-size: 0.65rem;
  background: var(--face);
  color: var(--ink-soft);
}
.admin-row .mini {
  width: 24px; height: 22px;
  display: grid; place-items: center;
  background: var(--face);
  border: 0; cursor: pointer; font-size: 0.7rem;
  box-shadow:
    inset 1px 1px 0 0 var(--light),
    inset -1px -1px 0 0 var(--dark);
}
.admin-row.is-child .grow::before { content: "└ "; color: var(--ink-soft); }

.repo-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem; font-size: 0.76rem; }
.repo-row input { cursor: pointer; }
.repo-desc { display: block; color: var(--ink-soft); font-size: 0.7rem; }

.item-form { margin-top: 0.8rem; padding-top: 0.8rem; border-top: 2px groove var(--face-dark); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 0.8rem; }
.form-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

.admin-foot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
  padding-top: 0.7rem;
  border-top: 2px groove var(--face-dark);
  flex-wrap: wrap;
}
.admin-count { flex: 1; font-size: 0.72rem; color: var(--ink-soft); }

/* =========================================================
   STAR WARS — caza TIE y Estrella de la Muerte
   ========================================================= */
.sw-fx { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.sw-fx[hidden] { display: none; }

.tie-fighter,
.death-star {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  will-change: transform, opacity;
  image-rendering: pixelated;
}
.tie-fighter svg,
.death-star svg { width: 100%; height: 100%; display: block; }

.tie-fighter { width: 34px; height: 34px; }
.tie-fighter.flying { opacity: 1; }

.death-star {
  width: 60px;
  height: 60px;
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.6));
  transition: opacity 0.9s ease;
}
.death-star.visible { opacity: 0.95; }

.tie-laser {
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: #35ff6a;
  box-shadow: 0 0 8px 2px rgba(53, 255, 106, 0.8);
  will-change: transform, opacity;
}

.death-star.exploding svg { animation: dsBlast 900ms ease-in forwards; }
@keyframes dsBlast {
  0%   { filter: brightness(1);  transform: scale(1); }
  25%  { filter: brightness(4);  transform: scale(1.04); }
  45%  { filter: brightness(9);  transform: scale(0.96); }
  100% { filter: brightness(22); transform: scale(1.5); opacity: 0; }
}

.ds-flash {
  position: absolute;
  left: 0; top: 0;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #ffe9a8 35%, rgba(255,170,60,0.5) 60%, transparent 72%);
  animation: dsFlash 1100ms ease-out forwards;
}
@keyframes dsFlash {
  0%   { width: 0; height: 0; margin: 0; opacity: 1; }
  35%  { width: 150px; height: 150px; margin: -75px; opacity: 1; }
  100% { width: 260px; height: 260px; margin: -130px; opacity: 0; }
}

.ds-ring {
  position: absolute;
  left: 0; top: 0;
  border-radius: 50%;
  border: 5px solid rgba(255, 224, 150, 0.9);
  animation: dsRing 1100ms cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
.ds-ring.flat { animation-name: dsRingFlat; border-color: rgba(255, 190, 110, 0.85); }
@keyframes dsRing {
  0%   { width: 10px; height: 10px; margin: -5px; opacity: 1; border-width: 6px; }
  100% { width: 320px; height: 320px; margin: -160px; opacity: 0; border-width: 1px; }
}
@keyframes dsRingFlat {
  0%   { width: 10px; height: 10px; margin: -5px; opacity: 1; border-width: 6px; transform: scaleY(0.18); }
  100% { width: 460px; height: 460px; margin: -230px; opacity: 0; border-width: 1px; transform: scaleY(0.18); }
}

/* =========================================================
   MÓVIL
   Las ventanas ocupan casi toda la pantalla: arrastrar
   ventanitas con el dedo no funciona bien.
   ========================================================= */
@media (max-width: 640px) {
  :root { --taskbar-h: 46px; }

  .win:not(.is-max) {
    inset: 8px 8px calc(var(--taskbar-h) + 8px) 8px !important;
    width: auto !important;
    height: auto !important;
  }
  .win-grip { display: none; }
  .win-bar { cursor: inherit; }

  .icon-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); grid-auto-rows: 88px; }
  .d-icon-img { width: 34px; height: 34px; }

  .linkedin-btn span { display: none; }
  .task-buttons .tb-btn { flex: 1 1 40px; }
  .clock-date { display: none; }
  .start-btn span:not(.start-logo) { display: none; }
}

/* =========================================================
   ACCESIBILIDAD: respeta "reducir movimiento" del sistema
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
