/* ==========================================================
   Portfolio de Zulema Gutiérrez · estilos
   Paleta lila / azul, estética de escritorio retro.
   ========================================================== */

:root {
  --tb: 46px;

  --ink: #1d1a3f;
  --muted: #6b62a0;
  --face: #ddd4f6;
  --face-lt: #f1ecff;
  --hi: #ffffff;
  --sh: #9384c9;
  --dk: #2a2360;
  --paper: #fbf9ff;
  --line: #cbbdf2;

  --accent: #6a4fd8;
  --blue: #3552d1;
  --pink: #ff8fc7;
  --yellow: #ffd66b;

  --title-a: #2c3a9e;
  --title-b: #9a7cf0;
  --title-off-a: #8b86ab;
  --title-off-b: #bfb8da;

  --term-bg: #120f2e;
  --term-fg: #d9ccff;
  --term-acc: #7fe3ff;
  --term-ok: #9dffb0;
  --term-err: #ff8fc7;
  --term-dim: #8a80b8;

  --font-ui: 'Pixelify Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --font-term: 'VT323', ui-monospace, Consolas, monospace;
  --font-sans: 'IBM Plex Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }
body {
  overflow: hidden;
  font-family: var(--font-mono);
  color: var(--ink);
  background: #3f4fc4;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
a { color: var(--blue); }
:focus-visible { outline: 2px dotted var(--ink); outline-offset: 2px; }

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

/* ---------- Relieve clásico ---------- */

.btn, .t-btn, .start-btn, .task, .quick-btn {
  background: var(--face);
  border: 2px solid;
  border-color: var(--hi) var(--dk) var(--dk) var(--hi);
  box-shadow: inset -1px -1px var(--sh), inset 1px 1px var(--face-lt);
  cursor: pointer;
}
.btn:active, .t-btn:active, .start-btn.pressed, .start-btn:active,
.task[aria-pressed="true"], .quick-btn:active {
  border-color: var(--dk) var(--hi) var(--hi) var(--dk);
  box-shadow: inset 1px 1px var(--sh);
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  font: 500 15px/1.2 var(--font-ui);
  color: var(--ink);
  text-decoration: none;
}
.btn:active { padding: 7px 13px 5px 15px; }
.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: #c9b8ff var(--dk) var(--dk) #c9b8ff;
  box-shadow: inset -1px -1px #4a33a8, inset 1px 1px #8d74ec;
}
.link {
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--blue); text-decoration: underline; text-underline-offset: 2px;
  font: inherit;
}

/* ---------- Arranque ---------- */

.boot {
  position: fixed; inset: 0; z-index: 5000;
  padding: 28px 32px;
  background: #0b0920;
  color: #cdbbff;
  font: 22px/1.35 var(--font-term);
  cursor: pointer;
  transition: opacity .35s;
}
.boot pre { margin: 0; font: inherit; white-space: pre-wrap; }
.boot .ok { color: var(--term-ok); }
.boot-out { opacity: 0; }
.boot-skip {
  position: absolute; left: 32px; bottom: 24px; margin: 0;
  color: #7a6fb0;
  animation: blink 1.1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Escritorio y fondo ---------- */

.desktop {
  position: fixed; inset: 0 0 var(--tb) 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 40% at 50% 58%, rgba(255, 170, 225, .45), transparent 70%),
    linear-gradient(180deg, #33409f 0%, #5d63d6 35%, #9a82ee 60%, #e2b3ee 72%);
}
.desktop::after { /* líneas de monitor CRT */
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: repeating-linear-gradient(0deg, rgba(20, 10, 60, .06) 0 1px, transparent 1px 3px);
}

.wallpaper { position: absolute; inset: 0; pointer-events: none; }
.sun {
  position: absolute; left: 50%; top: 66%;
  width: min(48vmin, 440px); aspect-ratio: 1;
  transform: translate(-50%, -78%);
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe6a6 0%, #ffa6d5 45%, #b58cff 85%);
  -webkit-mask:
    linear-gradient(#000 0 0) top / 100% 50% no-repeat,
    repeating-linear-gradient(180deg, #000 0 14px, transparent 14px 21px);
  mask:
    linear-gradient(#000 0 0) top / 100% 50% no-repeat,
    repeating-linear-gradient(180deg, #000 0 14px, transparent 14px 21px);
}
.floor {
  position: absolute; left: -50%; right: -50%; top: 66%; bottom: -10%;
  z-index: 0;
  background-color: #2a1f6e;
  background-image:
    linear-gradient(rgba(255, 170, 230, .7) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 170, 230, .7) 2px, transparent 2px);
  background-size: 64px 44px;
  transform: perspective(240px) rotateX(55deg);
  transform-origin: 50% 0;
  animation: floor 2.6s linear infinite;
  box-shadow: 0 -2px 18px 2px rgba(255, 160, 220, .8);
}
@keyframes floor { to { background-position: 0 44px; } }

.wordmark {
  position: absolute; left: 50%; top: 66%;
  transform: translate(-50%, 18px);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center; white-space: nowrap;
  z-index: 2; /* por encima del suelo 3D */
}
.wm-title {
  font: 700 clamp(30px, 6.2vw, 84px)/1 var(--font-ui);
  color: #fff;
  letter-spacing: .02em;
  text-shadow: 3px 3px 0 var(--blue), 6px 6px 0 var(--pink), 0 0 30px rgba(255, 160, 220, .6);
}
.wm-title b { color: #ffe6a6; }
.wm-role {
  padding: 2px 10px;
  background: rgba(29, 26, 63, .55);
  color: #f1ecff;
  font: 16px/1.4 var(--font-mono);
  letter-spacing: .04em;
}

/* ---------- Iconos del escritorio ---------- */

.icons {
  position: absolute; top: 12px; bottom: 12px; left: 10px;
  z-index: 2;
  display: grid; grid-auto-flow: column;
  grid-template-rows: repeat(auto-fill, 94px);
  grid-auto-columns: max-content;
  align-content: start; justify-content: start; gap: 4px 6px;
}
.d-icon {
  width: 116px; padding: 6px 2px;   /* cabe "Herramientas" en una línea */
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: 1px dotted transparent;
  color: #fff; cursor: pointer;
}
.d-icon svg { width: 42px; height: 42px; filter: drop-shadow(2px 2px 0 rgba(20, 10, 60, .4)); }
.d-icon span {
  padding: 1px 4px;
  font: 14px/1.15 var(--font-ui);
  text-align: center; overflow-wrap: anywhere;
  text-shadow: 1px 1px 0 var(--ink), 0 0 6px rgba(29, 26, 63, .7);
}
.d-icon:hover span { background: rgba(29, 26, 63, .4); }
.d-icon:focus-visible { outline: 1px dotted #fff; outline-offset: 0; }
.d-icon:focus-visible span, .d-icon:active span { background: var(--blue); text-shadow: none; }
.d-icon { touch-action: none; }
/* Colocación libre (cuando el visitante ha movido algún icono) */
.icons.free { inset: 0; display: block; pointer-events: none; }
.icons.free .d-icon { position: absolute; pointer-events: auto; }
.d-icon.dragging { z-index: 5; opacity: .85; cursor: grabbing; }
.d-group {
  position: absolute; top: 8px; width: 114px;
  padding: 1px 4px; text-align: center;
  background: rgba(29, 26, 63, .45); border-bottom: 2px solid rgba(255, 255, 255, .5);
  color: #fff; font: 600 12px var(--font-ui); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  text-shadow: 1px 1px 0 var(--ink);
  pointer-events: none;
}
.d-icon.dragging span { background: var(--blue); text-shadow: none; }
.d-icon:active svg { filter: drop-shadow(2px 2px 0 rgba(20, 10, 60, .4)) brightness(.8) sepia(.4) hue-rotate(200deg); }

/* ---------- Mascotas ---------- */

.pets { position: absolute; left: 0; right: 0; bottom: 6px; height: 0; z-index: 2; pointer-events: none; }
.pet {
  position: absolute; left: 0; bottom: 0;
  padding: 0; border: 0; background: none;
  cursor: pointer; pointer-events: auto;
}
.pet img {
  display: block;
  image-rendering: pixelated;
  filter: drop-shadow(0 3px 0 rgba(10, 5, 40, .45));
}
.pet[data-kind="black"] img {
  filter: drop-shadow(0 0 1px rgba(220, 205, 255, .9)) drop-shadow(0 3px 0 rgba(10, 5, 40, .45));
}
.pet:focus-visible { outline: 2px dotted #fff; }
.pet-bowl {
  position: absolute; left: 0; bottom: 0;
  padding: 0; border: 0; background: none;
  cursor: pointer; pointer-events: auto;
}
.pet-bowl img { display: block; image-rendering: pixelated; filter: drop-shadow(0 3px 0 rgba(10, 5, 40, .45)); }
.pet-bowl:hover img { filter: drop-shadow(0 0 3px #ffe6a6) drop-shadow(0 3px 0 rgba(10, 5, 40, .45)); }
.pet-bowl:focus-visible { outline: 2px dotted #fff; }
.pet-bubble {
  position: absolute; left: 50%; bottom: calc(100% + 8px);
  transform: translateX(-50%);
  padding: 3px 9px;
  background: #fff; color: var(--ink);
  border: 2px solid var(--dk); box-shadow: 3px 3px 0 var(--accent);
  font: 14px/1.2 var(--font-ui); white-space: nowrap;
  animation: pop .15s ease-out;
}
.pet-bubble::after {
  content: ''; position: absolute; left: 50%; top: 100%;
  width: 8px; height: 8px; margin: -3px 0 0 -4px;
  background: #fff; border: solid var(--dk); border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.pet-zzz {
  position: absolute; left: 60%; bottom: 100%;
  color: #e9dcff; font: 16px var(--font-ui); letter-spacing: 2px;
  text-shadow: 1px 1px 0 var(--dk);
  animation: zzz 2.4s ease-in-out infinite;
}
.pet-heart {
  position: absolute; left: 50%; bottom: 60%;
  font-size: 18px; pointer-events: none;
  transform: translateX(-50%);
  animation: heart 1s ease-out forwards;
}
@keyframes pop { from { transform: translateX(-50%) scale(.6); opacity: 0; } }
@keyframes zzz { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-6px); opacity: 1; } }
@keyframes heart { to { transform: translate(-50%, -40px) scale(1.3); opacity: 0; } }

/* ---------- Ventanas ---------- */

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

.window {
  position: absolute;
  display: flex; flex-direction: column;
  min-width: 300px; min-height: 160px;
  max-width: 100%; max-height: 100%;
  padding: 3px;
  background: var(--face);
  border: 2px solid;
  border-color: var(--hi) var(--dk) var(--dk) var(--hi);
  box-shadow: inset -2px -2px var(--sh), inset 2px 2px var(--face-lt), 8px 10px 0 rgba(29, 20, 80, .28);
  overflow: hidden;
  pointer-events: auto;
  animation: win-in .14s ease-out;
}
.window:focus { outline: none; }
.window.maximized {
  top: 0 !important; left: 0 !important; right: 0; bottom: 0;
  width: auto !important; height: auto !important;
  box-shadow: inset -2px -2px var(--sh), inset 2px 2px var(--face-lt);
}
.window.dragging { opacity: .92; }

/* Bordes y esquinas para cambiar el tamaño (invisibles salvo el agarre de la esquina) */
.rs { position: absolute; z-index: 5; touch-action: none; }
.rs-n, .rs-s { left: 14px; right: 14px; height: 6px; cursor: ns-resize; }
.rs-e, .rs-w { top: 14px; bottom: 14px; width: 6px; cursor: ew-resize; }
.rs-n { top: 0; }
.rs-s { bottom: 0; }
.rs-e { right: 0; }
.rs-w { left: 0; }
.rs-ne, .rs-nw, .rs-se, .rs-sw { width: 14px; height: 14px; }
.rs-ne { top: 0; right: 0; cursor: nesw-resize; }
.rs-sw { bottom: 0; left: 0; cursor: nesw-resize; }
.rs-nw { top: 0; left: 0; cursor: nwse-resize; }
.rs-se { bottom: 0; right: 0; width: 18px; height: 18px; cursor: nwse-resize; }
/* Agarre retro en la esquina de abajo a la derecha, como en los sistemas de los 90 */
.rs-se::after {
  content: ''; position: absolute; right: 3px; bottom: 3px; width: 11px; height: 11px;
  background:
    linear-gradient(135deg, transparent 46%, var(--dk) 46% 54%, transparent 54%) 0 0 / 100% 100%,
    linear-gradient(135deg, transparent 46%, var(--dk) 46% 54%, transparent 54%) 4px 4px / 7px 7px no-repeat,
    linear-gradient(135deg, transparent 46%, var(--dk) 46% 54%, transparent 54%) 8px 8px / 3px 3px no-repeat;
  background-repeat: no-repeat;
  opacity: .7;
}
.window.maximized .rs { display: none; }
.window.resizing { opacity: .96; }
/* Mientras se mueve o redimensiona, que los iframes no se queden con el ratón */
body.moving-win iframe { pointer-events: none; }
body.moving-win { user-select: none; }
@keyframes win-in { from { opacity: 0; transform: scale(.96); } }

.titlebar {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 3px 0 6px;
  background: linear-gradient(90deg, var(--title-a), var(--title-b));
  color: #fff;
  cursor: grab; user-select: none; touch-action: none;
}
.titlebar:active { cursor: grabbing; }
.window.maximized .titlebar { cursor: default; }
.window:not(.active) .titlebar { background: linear-gradient(90deg, var(--title-off-a), var(--title-off-b)); }
.t-icon svg { display: block; width: 20px; height: 20px; }
.t-title {
  flex: 1; margin: 0;
  font: 600 16px/1 var(--font-ui); letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.t-btns { display: flex; gap: 2px; }
.t-btn { width: 26px; height: 22px; padding: 0; display: grid; place-items: center; color: var(--ink); }
.t-btn svg { width: 9px; height: 9px; }
.t-btn[data-act="close"] { margin-left: 3px; }

.window-body {
  flex: 1; min-height: 0;
  overflow: auto;
  margin-top: 3px; padding: 18px;
  background: var(--paper);
  border: 2px solid;
  border-color: var(--sh) var(--hi) var(--hi) var(--sh);
  font-size: 14px; line-height: 1.6;
  scrollbar-color: var(--sh) var(--face-lt);
}
.window-body p { margin: 0 0 10px; }
.window-body h3 { margin: 0 0 6px; font: 600 20px/1.2 var(--font-ui); }
.muted { color: var(--muted); }
.center { text-align: center; }

code {
  padding: 0 5px;
  background: #ece6ff; border: 1px solid var(--line);
  font: 13px var(--font-mono);
}

/* Barra de dirección tipo explorador */
.addr-bar {
  display: flex; align-items: center; gap: 8px;
  margin: -18px -18px 16px; padding: 6px 8px;
  background: var(--face); border-bottom: 1px solid var(--sh);
  font: 14px var(--font-ui);
}
.addr {
  flex: 1; padding: 3px 8px;
  background: #fff;
  border: 2px solid; border-color: var(--sh) var(--hi) var(--hi) var(--sh);
  font: 13px var(--font-mono);
}

.sec-title {
  margin: 0 0 14px; padding-bottom: 6px;
  color: var(--accent);
  border-bottom: 2px dotted var(--line);
}
.window-body .sec-title { font-size: 18px; }
.sec-title:not(:first-child) { margin-top: 26px; }

/* Chips */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.chips li {
  padding: 2px 10px;
  background: #fff;
  border: 2px solid var(--dk);
  box-shadow: 2px 2px 0 var(--accent);
  font-size: 13px;
}

/* Bienvenida */
.welcome-hero { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 8px; }
.tips { list-style: none; margin: 12px 0; padding: 0; }
.tips li {
  display: flex; gap: 12px; align-items: center;
  padding: 8px 0; border-top: 1px dotted var(--line);
}
.tips svg, .tips img { flex: none; width: 28px; height: 28px; }
.tips img, .start-item img { image-rendering: pixelated; object-fit: contain; }
.start-item img { flex: none; width: 26px; height: 26px; }
.row-end { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }


/* Retrato ilustrado */
.portrait {
  display: block; flex: none; border-radius: 50%; object-fit: cover;
  background: #120f2e;
  box-shadow: 0 0 0 3px var(--dk), 0 0 18px rgba(154, 124, 240, .65);
}
.about-portrait { width: 108px; height: 108px; }
.welcome-portrait { width: 72px; height: 72px; }
.cv-portrait { width: 120px; height: 120px; }
.start-user {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 4px; padding: 8px 10px 10px;
  border-bottom: 1px solid var(--sh);
  background: linear-gradient(90deg, rgba(154, 124, 240, .25), transparent);
}
.start-user .portrait { width: 46px; height: 46px; box-shadow: 0 0 0 2px var(--dk), 0 0 10px rgba(154, 124, 240, .6); }
.start-user b { display: block; font: 700 16px/1.1 var(--font-ui); }
.start-user small { display: block; margin-top: 2px; font-size: 10.5px; line-height: 1.3; color: var(--muted); }

/* Sobre mí */
.about-head { display: flex; gap: 18px; align-items: center; margin-bottom: 16px; }
.about-head h3 { font-size: 26px; }
.window-body .role { margin: 0 0 6px; color: var(--blue); font-weight: 500; }
.window-body .status { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; }
.status::before {
  content: ''; width: 10px; height: 10px;
  background: #3ecf6e; border: 2px solid var(--dk);
}
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 16px 0; }
.facts div { padding: 8px 10px; background: #fff; border: 2px solid var(--line); font-size: 13.5px; font-weight: 500; }
.facts span {
  display: block; margin-bottom: 2px;
  color: var(--muted); font-size: 11px; font-weight: 400;
  text-transform: uppercase; letter-spacing: .1em;
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Línea temporal */
.timeline { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 3px solid var(--line); }
.timeline > li { position: relative; padding: 0 0 20px 14px; }
.timeline > li:last-child { padding-bottom: 4px; }
.timeline > li::before {
  content: ''; position: absolute; left: -29px; top: 4px;
  width: 12px; height: 12px;
  background: var(--accent); border: 2px solid var(--dk);
}
.tl-date { color: var(--muted); font-size: 12.5px; }
.window-body .tl-role { margin: 2px 0 0; font: 600 17px/1.3 var(--font-ui); }
.window-body .tl-org { margin: 0 0 6px; color: var(--blue); font-weight: 500; }
.timeline ul { margin: 0; padding-left: 18px; }
.timeline ul li { margin-bottom: 3px; }
.timeline .pending::before, .cv-job.pending h3::before { background: transparent; border-style: dashed; }
.pending .tl-org, .cv-job.pending .meta { color: var(--pink); filter: brightness(.8); }

/* Proyectos */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px;
  background: #fff;
  border: 2px solid var(--dk);
  box-shadow: 4px 4px 0 var(--line);
  transition: transform .12s, box-shadow .12s;
}
.card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--accent); }
.card-head { display: flex; align-items: center; gap: 10px; }
.card-head svg { flex: none; width: 32px; height: 32px; }
.window-body .card h4 { margin: 0; font: 600 17px/1.2 var(--font-ui); }
.card p { margin: 0; font-size: 13.5px; }
.badge {
  align-self: flex-start;
  padding: 0 8px;
  border: 1px solid currentColor;
  font-size: 12px;
}
.badge.live { color: #1c7a44; background: #e2fbe9; }
.badge.pro { color: var(--blue); background: #e8ecff; }
.card.ghost {
  align-items: center; justify-content: center; gap: 6px;
  min-height: 170px;
  background: transparent; box-shadow: none;
  border-style: dashed; color: var(--muted);
  text-align: center;
}
.card.ghost:hover { transform: none; box-shadow: none; }
.card.ghost svg { width: 32px; height: 32px; opacity: .6; }

.card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }

/* Ventanas con otra página dentro (Monitor.exe) */
.window-body.frame { padding: 0; overflow: hidden; background: #efe9ff; }
.app-frame { display: block; width: 100%; height: 100%; border: 0; }

/* Calendario */
.cal { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 18px; }
.cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.cal-head h3 { flex: 1; margin: 0; text-align: center; font-size: 19px; }
.cal-head .btn { padding: 4px 10px; }
.cal-grid { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.cal-grid th { font: 600 13px var(--font-ui); color: var(--muted); padding-bottom: 2px; }
.cal-grid td { padding: 0; }
.cal-day {
  position: relative; width: 100%; aspect-ratio: 1 / .82;
  display: flex; align-items: flex-start; justify-content: flex-start;
  padding: 3px 5px;
  background: #fff; border: 2px solid var(--line);
  font: 500 14px var(--font-mono); color: var(--ink);
  cursor: pointer;
}
.cal-day:hover { border-color: var(--accent); }
.cal-day.weekend { background: #f6f2ff; }
.cal-day.out { opacity: .4; }
.cal-day.holiday { background: #ffe3f0; border-color: #ffb3d4; color: #b3265a; }
.cal-day.special { border-color: #b79cf5; }
.cal-day.today { border-color: var(--dk); box-shadow: inset 0 0 0 2px var(--yellow); font-weight: 700; }
.cal-day.selected { background: var(--accent); border-color: var(--dk); color: #fff; }
.cal-dot { position: absolute; right: 3px; bottom: 1px; font-size: 12px; line-height: 1.2; }
.cal-book { margin: 14px 0 0; }
.cal-book p { margin: 0; font-size: 13px; }
.cal-book .btn { white-space: normal; text-align: left; }
.cal-sel-events { list-style: none; margin: 0 0 8px; padding: 0; font-size: 13px; }
.cal-side h4 { margin: 0 0 6px; color: var(--accent); font: 600 16px var(--font-ui); }
.cal-side h4:not(:first-child) { margin-top: 16px; }
.cal-list { list-style: none; margin: 0; padding: 0; font-size: 12.5px; line-height: 1.45; }
.cal-list li { padding: 4px 0; border-bottom: 1px dotted var(--line); }
.cal-list b { display: inline-block; min-width: 20px; }
.cal-list .is-holiday { color: #b3265a; }
.cal-story li.current { background: #f1ecff; margin: 0 -6px; padding: 4px 6px; border-left: 3px solid var(--accent); }
.cal-story .link { font-weight: 600; }

/* Carpeta de juegos */
.launcher { display: flex; flex-wrap: wrap; gap: 10px; }
.launch {
  width: 118px; padding: 10px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: none; border: 1px dotted transparent; cursor: pointer;
  font: 14px/1.2 var(--font-ui); text-align: center; overflow-wrap: anywhere;
}
.launch svg { width: 48px; height: 48px; }
.launch:hover, .launch:focus-visible { background: #ece6ff; border-color: var(--accent); outline: none; }

/* Juegos: elementos comunes */
.window-body.game { display: flex; flex-direction: column; gap: 10px; }
.game-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.game-field { display: inline-flex; align-items: center; gap: 6px; font: 14px var(--font-ui); }
.game-field select {
  padding: 4px 6px; font: 14px var(--font-ui);
  background: #fff; border: 2px solid; border-color: var(--sh) var(--hi) var(--hi) var(--sh);
}
.game-stat {
  margin-left: auto; padding: 2px 8px;
  background: var(--term-bg); color: var(--term-ok);
  font: 18px/1.2 var(--font-term); letter-spacing: .05em;
}
.game-stat + .game-stat { margin-left: 0; }
.game-msg { min-height: 1.5em; margin: 0; text-align: center; font: 15px var(--font-ui); color: var(--accent); }

/* Sudoku */
.sdk {
  display: grid; grid-template-columns: repeat(9, 1fr);
  width: 100%; max-width: 420px; aspect-ratio: 1; margin: 0 auto;
  background: var(--dk); border: 3px solid var(--dk); gap: 1px;
}
.sdk:focus { outline: none; }
.sdk:focus-visible { outline: 2px dotted var(--accent); outline-offset: 3px; }
.sdk-cell {
  display: grid; place-items: center; min-width: 0;
  padding: 0; background: #fff; border: 0; cursor: pointer;
  font: 600 clamp(15px, 4.5vmin, 22px) var(--font-mono); color: var(--accent);
}
.sdk-cell.bx-r { margin-right: 2px; }
.sdk-cell.bx-b { margin-bottom: 2px; }
.sdk-cell.given { color: var(--ink); font-weight: 700; }
.sdk-cell.related { background: #f1ecff; }
.sdk-cell.same { background: #e0d4ff; }
.sdk-cell.selected { background: var(--yellow); }
.sdk-cell.conflict { color: #d6245c; background: #ffe0ec; }
.sdk.won .sdk-cell { background: #e2fbe9; }
.sdk-pad { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.sdk-pad .btn { justify-content: center; padding: 6px 0; font-size: 16px; }
.sdk-pad .sdk-erase { font-size: 12px; }

/* Sopa de letras */
.ws { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 14px; align-items: start; }
.ws-grid {
  display: grid; grid-template-columns: repeat(var(--n), 1fr);
  aspect-ratio: 1; max-width: 480px;
  background: #fff; border: 2px solid var(--dk);
  user-select: none; touch-action: none;
}
.ws-cell {
  display: grid; place-items: center;
  font: 600 clamp(12px, 2.6vmin, 18px) var(--font-mono); cursor: pointer;
}
.ws-cell.found { background: var(--c); }
.ws-cell.picking { background: var(--yellow); outline: 1px solid var(--dk); }
.ws-side h4 { margin: 0 0 6px; font: 600 15px var(--font-ui); color: var(--accent); }
.ws-words { list-style: none; margin: 0 0 10px; padding: 0; columns: 2; column-gap: 8px; font: 500 12.5px var(--font-mono); }
.ws-words li { padding: 1px 4px; border-left: 4px solid var(--c); margin-bottom: 3px; break-inside: avoid; }
.ws-words li.found {
  text-decoration: line-through; color: var(--muted);
  background: #e7dcff;   /* respaldo si el navegador no soporta color-mix */
  background: color-mix(in srgb, var(--c) 35%, transparent);
}
.ws-hint { font-size: 12px; margin: 0; }

/* Tetris */
.tt { display: flex; gap: 12px; justify-content: center; outline: none; }
.tt:focus-visible { outline: 2px dotted var(--accent); outline-offset: 4px; }
.tt-board-wrap { position: relative; border: 3px solid var(--dk); box-shadow: 4px 4px 0 var(--line); line-height: 0; }
.tt-board { display: block; width: 220px; height: 440px; image-rendering: pixelated; }
.tt-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; text-align: center;
  background: rgba(18, 15, 46, .78); color: #fff; line-height: 1.3;
  font: 15px var(--font-ui);
}
.tt-overlay b { font: 700 26px var(--font-ui); color: var(--yellow); letter-spacing: .06em; }
.tt-overlay small { color: #cdbbff; }
.tt-overlay:has(.tt-flash) { background: transparent; pointer-events: none; }
.tt-flash { animation: pop .3s ease-out; text-shadow: 2px 2px 0 var(--dk); }
.tt-side { display: flex; flex-direction: column; gap: 8px; width: 104px; }
.tt-box {
  display: flex; flex-direction: column; gap: 2px;
  padding: 5px 8px; background: #fff; border: 2px solid var(--dk);
}
.tt-box b { font: 22px/1 var(--font-term); color: var(--accent); }
.tt-l { font: 12px var(--font-ui); color: var(--muted); }
.tt-next { display: block; width: 88px; height: 66px; margin-top: 2px; }
.tt-pad { display: none; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.tt-pad .btn { justify-content: center; padding: 8px 0; font-size: 16px; }
.tt-keys { margin: 0; font-size: 11.5px; text-align: center; }
@media (pointer: coarse), (max-width: 720px) {
  .tt-pad { display: grid; }
  .tt-keys { display: none; }
}

/* Notas */
.window-body.notes-body { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.notes-bar { display: flex; gap: 6px; padding: 6px; background: var(--face); border-bottom: 1px solid var(--sh); }
.notes-bar .btn { padding: 3px 10px; font-size: 13.5px; }
.notes-text {
  flex: 1; min-height: 0; resize: none;
  padding: 10px 14px; border: 0; outline: 0;
  background: #fffdf2 repeating-linear-gradient(transparent 0 23px, #ece4c8 23px 24px);
  background-attachment: local;
  font: 15px/24px var(--font-mono); color: var(--ink);
}
.notes-status {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 3px 10px; background: var(--face); border-top: 1px solid var(--sh);
  font: 12.5px var(--font-ui); color: var(--muted);
}

/* Paint.exe */
.window-body.paint-body { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.pt-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; background: var(--face); border-bottom: 1px solid var(--sh); }
.pt-bar .btn { padding: 3px 10px; font-size: 13.5px; }
.pt-bar .btn:disabled { opacity: .5; cursor: default; }
.pt-sep { align-self: stretch; width: 1px; margin: 0 2px; background: var(--sh); }
.pt-resize {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 6px 8px; background: var(--face-lt); border-bottom: 1px solid var(--sh);
  font: 13px var(--font-ui);
}
.pt-resize[hidden] { display: none; }
.pt-resize input { width: 76px; padding: 2px 4px; font: 13px var(--font-mono); }
.pt-resize .btn { padding: 2px 10px; font-size: 13px; }
.pt-main { flex: 1; min-height: 0; display: flex; }
.pt-side {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px;
  padding: 6px; background: var(--face); border-right: 1px solid var(--sh); overflow-y: auto;
}
.pt-tools, .pt-opts { display: grid; grid-template-columns: repeat(2, 32px); gap: 3px; }
.pt-opts { padding: 3px; background: var(--face-lt); border: 1px solid var(--sh); }
.pt-opts[hidden] { display: none; }
.pt-textopts { display: flex; flex-direction: column; gap: 4px; }
.pt-textopts[hidden] { display: none; }
.pt-textopts select { width: 67px; padding: 1px; font: 12px var(--font-ui); }
.pt-tool, .pt-opt {
  width: 32px; height: 30px; padding: 0;
  display: grid; place-items: center;
  background: var(--face); color: var(--ink);
  border: 2px solid; border-color: var(--hi) var(--dk) var(--dk) var(--hi);
  font-size: 16px; line-height: 1; cursor: pointer;
}
.pt-tool.on, .pt-opt.on { border-color: var(--dk) var(--hi) var(--hi) var(--dk); background: var(--face-lt); }
.pt-opt i { display: block; background: var(--ink); border-radius: 50%; }
.pt-opt .pt-shape { width: 18px; height: 12px; border: 2px solid var(--ink); border-radius: 0; background: none; }
.pt-opt .pt-shape.filled { background: var(--accent); }
.pt-wrap { flex: 1; min-width: 0; overflow: auto; padding: 10px; background: #8d88ad; }
.pt-stage { position: relative; background: #fff; box-shadow: 4px 4px 0 rgba(29, 20, 80, .45); }
.pt-stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
/* De cerca se ven los píxeles tal cual, sin difuminar */
.pt-stage.pixeles canvas { image-rendering: pixelated; }
.pt-preview { cursor: crosshair; touch-action: none; }
.paint-body[data-tool="text"] .pt-preview { cursor: text; }
/* Recuadro de la selección: línea fina a cualquier zoom */
.pt-selbox {
  position: absolute; z-index: 2; pointer-events: none;
  border: 1px dashed #1d1a3f; box-shadow: 0 0 0 1px rgba(255, 255, 255, .85);
}
.pt-selbox[hidden], .pt-outline[hidden] { display: none; }
.pt-outline { position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; border: 1px dashed var(--dk); }
.pt-textbox {
  position: absolute; z-index: 3; margin: 0; padding: 0;
  background: transparent; border: 1px dashed var(--accent); outline: none;
  resize: none; overflow: hidden; white-space: pre;
}
/* Esquina para cambiar el tamaño del lienzo arrastrando, como en Paint */
.pt-grip {
  position: absolute; right: -9px; bottom: -9px; z-index: 3;
  width: 9px; height: 9px; background: #fff; border: 1px solid var(--dk);
  cursor: nwse-resize; touch-action: none;
}
.pt-colors {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 6px 8px; background: var(--face); border-top: 1px solid var(--sh);
}
.pt-current { position: relative; flex: 0 0 auto; width: 38px; height: 34px; cursor: pointer; }
.pt-c1, .pt-c2 {
  position: absolute; width: 22px; height: 22px; padding: 0; cursor: pointer;
  border: 2px solid; border-color: var(--dk) var(--hi) var(--hi) var(--dk);
}
.pt-c1 { left: 0; top: 0; z-index: 1; }
.pt-c2 { right: 0; bottom: 0; }
.pt-palette { display: grid; grid-template-columns: repeat(10, 20px); gap: 2px; }
.pt-swatch {
  width: 20px; height: 17px; padding: 0; cursor: pointer;
  border: 2px solid; border-color: var(--dk) var(--hi) var(--hi) var(--dk);
}
.pt-custom { display: flex; align-items: center; gap: 6px; font: 13px var(--font-ui); cursor: pointer; }
.pt-custom input {
  width: 30px; height: 24px; padding: 0; cursor: pointer; background: none;
  border: 2px solid; border-color: var(--dk) var(--hi) var(--hi) var(--dk);
}
.pt-status {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 3px 10px; background: var(--face); border-top: 1px solid var(--sh);
  font: 12.5px var(--font-ui); color: var(--muted);
}
.pt-pos { min-width: 86px; }
.pt-msg { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: center; }
.pt-zoombox { display: inline-flex; align-items: center; gap: 3px; }
.pt-zbtn {
  width: 22px; height: 20px; padding: 0; cursor: pointer;
  background: var(--face); color: var(--ink);
  border: 2px solid; border-color: var(--hi) var(--dk) var(--dk) var(--hi);
  font: 700 13px/1 var(--font-ui);
}
.pt-zbtn:disabled { opacity: .45; cursor: default; }
.pt-zoom { padding: 0 2px; font: 12px var(--font-ui); }
@media (max-width: 720px) {
  .pt-msg, .pt-dim { display: none; }
  .pt-sep { display: none; }
  .pt-palette { grid-template-columns: repeat(10, 18px); }
  .pt-swatch { width: 18px; }
}

/* Binario.exe */
.bin-label { font: 14px var(--font-ui); }
.bin-size.pressed { background: var(--accent); color: #fff; }
.bin-leds {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 3px;
  padding: 12px 8px; background: var(--term-bg); border: 2px solid var(--dk);
}
.led { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0; background: none; border: 0; cursor: pointer; }
.led i {
  width: 22px; height: 22px; border-radius: 50%;
  background: #2b2566; border: 2px solid #3a3470;
  transition: background .15s, box-shadow .15s;
}
.led.on i { background: #d9c8ff; border-color: #fff; box-shadow: 0 0 10px 3px var(--accent), 0 0 3px #fff inset; }
.led small { font: 11px var(--font-term); color: var(--term-dim); }
.led-gap { width: 10px; }
.bin-ops { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.bin-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.bin-fields label { display: flex; flex-direction: column; gap: 2px; font: 13px var(--font-ui); color: var(--muted); }
.bin-in {
  padding: 5px 8px; font: 15px var(--font-mono); color: var(--ink);
  background: #fff; border: 2px solid; border-color: var(--sh) var(--hi) var(--hi) var(--sh);
}
.bin-in.bad { background: #ffe0ec; color: #b3265a; }
.bin-extra { margin: 0; text-align: center; font-size: 14px; }
.bin-extra b { font: 20px var(--font-term); color: var(--accent); }
.bin-hint { margin: 0; text-align: center; font-size: 12px; }

/* Apuntes (libreta) */
.window-body.nb-body { display: flex; padding: 0; overflow: hidden; background: #efe9ff; }
.nb-tabs { flex: none; display: flex; flex-direction: column; gap: 6px; padding: 14px 0 14px 8px; }
.nb-tab {
  padding: 8px 14px 8px 10px;
  background: var(--face-lt);   /* respaldo */
  background: color-mix(in srgb, var(--tab) 55%, #fff);
  border: 2px solid var(--dk); border-right: 0;
  border-radius: 8px 0 0 8px;
  font: 600 14px var(--font-ui); text-align: left; white-space: nowrap; cursor: pointer;
  transform: translateX(6px); transition: transform .15s;
}
.nb-tab:hover { transform: translateX(2px); }
.nb-tab.active { background: var(--tab); transform: translateX(2px); box-shadow: -3px 3px 0 rgba(29, 20, 80, .2); }
.nb-page {
  flex: 1; min-width: 0; overflow: auto;
  padding: 22px 30px 30px 54px;
  border-left: 3px solid var(--tab);
  background:
    linear-gradient(90deg, transparent 38px, #ffb3d4 38px, #ffb3d4 40px, transparent 40px),
    linear-gradient(#e3ecff 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, #e3ecff 1px, transparent 1px) 0 0 / 22px 22px,
    #fffefa;
  background-attachment: local;
  font-size: 14.5px; line-height: 1.65;
}
.nb-page:focus { outline: none; }
.nb-page { position: relative; }
.nb-index {
  list-style: none; margin: 0 0 24px; padding: 10px 14px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2px 14px;
  background: #fff;
  border: 2px dashed var(--sh);   /* respaldo */
  border: 2px dashed color-mix(in srgb, var(--tab) 80%, var(--dk));
  transform: rotate(-.4deg);
}
.nb-index button {
  width: 100%; padding: 2px 0; background: none; border: 0; cursor: pointer;
  text-align: left; font: 13.5px/1.4 var(--font-mono); color: var(--ink);
}
.nb-index button:hover { text-decoration: underline; text-decoration-color: var(--tab); text-decoration-thickness: 3px; }
.nb-index b { color: var(--muted); margin-right: 4px; }
.nb-index code { font-size: 12px; }
.nb-num {
  display: inline-block; margin-right: 8px; padding: 0 6px;
  background: var(--dk); color: var(--tab);
  font: 700 15px/1.5 var(--font-term); vertical-align: 4px;
}
.nb-title { margin: 0 0 12px; font: 700 40px/1.1 'Caveat', var(--font-ui); color: var(--ink); }
.nb-title span { display: inline-block; transform: rotate(-8deg); }
.nb-sec { margin-bottom: 26px; }
.nb-sec h3 {
  display: inline-block; margin: 0 0 6px; padding: 0 6px;
  font: 700 26px/1.2 'Caveat', var(--font-ui); color: var(--dk);
  background: linear-gradient(transparent 55%, #e2d4ff 55%);   /* respaldo */
  background: linear-gradient(transparent 55%, color-mix(in srgb, var(--tab) 70%, transparent) 55%);
}
.nb-sec p { margin: 0 0 10px; }
.nb-page mark {
  background: linear-gradient(transparent 50%, #e2d4ff 50%);   /* respaldo */
  background: linear-gradient(transparent 50%, color-mix(in srgb, var(--tab) 65%, transparent) 50%);
  color: inherit; padding: 0 2px;
}
.nb-page code { font-size: 13px; }
.nb-code {
  margin: 10px 0; border: 2px solid var(--dk);
  box-shadow: 4px 4px 0 var(--line);   /* respaldo */
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--tab) 60%, transparent);
}
.nb-code-bar { display: flex; justify-content: space-between; align-items: center; padding: 3px 8px; background: var(--dk); color: #cdbbff; font: 13px var(--font-ui); }
.nb-copy { padding: 1px 8px; background: var(--face); border: 1px solid var(--hi); font: 12px var(--font-ui); cursor: pointer; }
.nb-code pre { margin: 0; padding: 12px 14px; overflow-x: auto; background: var(--term-bg); color: #e9e4ff; font: 13.5px/1.55 var(--font-mono); tab-size: 4; }
.nb-code code { padding: 0; background: none; border: 0; font: inherit; }
.hl-kw { color: #ff8fc7; font-weight: 600; }
.hl-st { color: #9dffb0; }
.hl-cm { color: #8a80b8; font-style: italic; }
.hl-nu { color: #ffd66b; }
.hl-fn { color: #7fe3ff; }
.hl-ty { color: #c3a6ff; }
.hl-an { color: #ffb38a; }
.nb-note { padding: 8px 12px; border: 2px dashed; border-radius: 4px; font-size: 13.5px; }
.nb-tip { background: #fff8d6; border-color: #e0b93a; }
.nb-warn { background: #ffe8f1; border-color: #ff8fc7; }
/* Mini test de cada tema */
.nb-quiz {
  margin: 30px 0 10px; padding: 14px 16px 12px;
  background: #fff; border: 3px solid var(--tab); border-radius: 6px;
  box-shadow: 5px 5px 0 var(--line);   /* respaldo */
  box-shadow: 5px 5px 0 color-mix(in srgb, var(--tab) 35%, transparent);
}
.nb-quiz h3 { margin-top: 0; }
.nb-quiz-sub { margin: -6px 0 14px; font-size: 13px; color: var(--muted); }
.nb-q { margin-bottom: 16px; }
.nb-q-t { margin: 0 0 8px; }
.nb-opts { display: flex; flex-direction: column; gap: 5px; }
.nb-opt {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 6px 10px; text-align: left;
  background: var(--face-lt); border: 2px solid var(--line); border-radius: 4px;
  font: 14px/1.4 var(--font-mono); color: var(--ink); cursor: pointer;
}
.nb-opt:hover:enabled { border-color: var(--tab); background: #fff; }
.nb-opt:disabled { cursor: default; }
.nb-opt-letra {
  flex: none; width: 20px; height: 20px; display: grid; place-items: center;
  background: #fff; border: 2px solid var(--dk); font: 600 12px var(--font-ui);
}
.nb-opt.ok { background: #e3fbef; border-color: #3ecf8e; }
.nb-opt.ok .nb-opt-letra { background: #3ecf8e; color: #fff; }
.nb-opt.mal { background: #ffe3ec; border-color: #ff5c8a; }
.nb-opt.mal .nb-opt-letra { background: #ff5c8a; color: #fff; }
.nb-opt.pasa { opacity: .55; }
.nb-quiz-end { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.nb-quiz-score { font: 700 17px var(--font-ui); }
.nb-btn {
  padding: 5px 12px;
  background: var(--face); border: 2px solid; border-color: var(--hi) var(--dk) var(--dk) var(--hi);
  box-shadow: inset -1px -1px var(--sh);
  font: 500 14px/1.2 var(--font-ui); color: var(--ink); cursor: pointer;
}
.nb-btn:active { border-color: var(--dk) var(--hi) var(--hi) var(--dk); }

.nb-cat { display: flex; align-items: flex-end; gap: 10px; margin: 12px 0 4px; }
.nb-cat img { flex: none; width: 57px; image-rendering: pixelated; }
.nb-cat p {
  position: relative; margin: 0 0 18px; padding: 8px 12px;
  background: #fff; border: 2px solid var(--dk); border-radius: 12px;
  font: 600 19px/1.25 'Caveat', var(--font-ui); transform: rotate(-1deg);
}
.nb-cat p::before {
  content: ''; position: absolute; left: -9px; bottom: 10px; width: 14px; height: 14px;
  background: #fff; border: solid var(--dk); border-width: 0 0 2px 2px; transform: rotate(45deg);
}
.nb-cat code { font-family: var(--font-mono); font-size: 13px; font-weight: 400; }
.nb-table { width: 100%; margin: 8px 0 12px; border-collapse: collapse; background: #fff; font-size: 13.5px; }
.nb-table th, .nb-table td { padding: 6px 10px; border: 2px solid var(--dk); text-align: left; vertical-align: top; }
.nb-table th { background: var(--tab); font: 600 14px var(--font-ui); }
@media (max-width: 720px) {
  .window-body.nb-body { flex-direction: column; }
  .nb-tabs { flex-direction: row; padding: 8px 8px 0; overflow-x: auto; }
  .nb-tab { border-radius: 8px 8px 0 0; border-right: 2px solid var(--dk); border-bottom: 0; transform: none; }
  .nb-page { padding: 16px 14px 24px 22px; border-left: 0; border-top: 3px solid var(--tab); background-position: -20px 0, 0 0, 0 0, 0 0; }
  .nb-title { font-size: 32px; }
}

/* Subredes.exe */
.sn-form { display: flex; flex-direction: column; gap: 6px; }
.sn-label { font: 14px var(--font-ui); color: var(--muted); }
.sn-row { display: flex; gap: 6px; }
.sn-in {
  flex: 1; min-width: 0; padding: 6px 10px; font: 17px var(--font-mono);
  background: #fff; border: 2px solid; border-color: var(--sh) var(--hi) var(--hi) var(--sh);
}
.sn-examples { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); }
.sn-bits { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 12px 6px; background: var(--term-bg); border: 2px solid var(--dk); }
.sn-octet { display: flex; flex-wrap: wrap; justify-content: center; width: 124px; }
.sn-octet i { width: 15px; text-align: center; font: 20px/1.3 var(--font-term); font-style: normal; }
.sn-octet small { width: 100%; text-align: center; color: var(--term-dim); font: 15px var(--font-term); }
.sn-bits .net, .sn-legend .net { color: #7fe3ff; }
.sn-bits .host, .sn-legend .host { color: #ff8fc7; }
.sn-legend { display: flex; justify-content: center; gap: 18px; font: 600 13px var(--font-ui); }
.sn-legend span::before { content: '■ '; }
.sn-legend .net { color: #1f8fb3; }
.sn-legend .host { color: #d6247a; }
.sn-table { display: grid; grid-template-columns: auto 1fr; gap: 0; margin: 0; border: 2px solid var(--dk); background: #fff; }
.sn-table dt, .sn-table dd { margin: 0; padding: 4px 10px; border-bottom: 1px dotted var(--line); }
.sn-table dt { color: var(--muted); font-size: 13px; background: #f7f3ff; }
.sn-table dd { font: 500 14.5px var(--font-mono); }
.sn-bad { grid-column: 1 / -1; margin: 0; padding: 10px; color: #b3265a; }
.sn-hint { margin: 0; font-size: 12.5px; text-align: center; }

/* Logros.exe */
.ach-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.ach-trophy svg { width: 64px; height: 64px; filter: drop-shadow(3px 3px 0 var(--line)); }
.ach-sum { flex: 1; }
.ach-sum p { margin: 2px 0 6px; font-size: 13px; color: var(--muted); }
.ach-bar { height: 16px; background: var(--term-bg); border: 2px solid var(--dk); padding: 2px; }
.ach-bar i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--yellow) 0 8px, #ffb347 8px 10px); transition: width .4s; }
.ach-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.ach-list li {
  display: flex; align-items: center; gap: 12px; padding: 6px 10px;
  background: #f1eef8; border: 2px dashed var(--line); color: var(--muted);
}
.ach-list li.done { background: #fff; border: 2px solid var(--dk); box-shadow: 3px 3px 0 var(--yellow); color: var(--ink); }
.ach-icon { width: 34px; font-size: 24px; text-align: center; filter: grayscale(1); opacity: .5; }
.done .ach-icon { filter: none; opacity: 1; }
.ach-list b { display: block; font: 600 15px var(--font-ui); }
.ach-list small { font-size: 12.5px; }
.ach-list time { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* Notificación de logro */
.ach-toast {
  position: fixed; right: 16px; bottom: calc(var(--tb) + 14px); z-index: 6600;
  display: flex; align-items: center; gap: 12px;
  min-width: 260px; padding: 10px 16px 10px 12px;
  background: var(--term-bg); color: #fff;
  border: 3px solid var(--yellow); box-shadow: 5px 5px 0 var(--dk), 0 0 24px rgba(255, 214, 107, .5);
  animation: ach-in .35s cubic-bezier(.2, 1.4, .5, 1);
}
.ach-toast.out { animation: ach-out .4s ease-in forwards; }
.ach-toast-icon { font-size: 30px; }
.ach-toast small { display: block; color: var(--yellow); font: 600 13px var(--font-ui); letter-spacing: .03em; }
.ach-toast b { font: 17px var(--font-ui); }
@keyframes ach-in { from { transform: translateY(40px) scale(.9); opacity: 0; } }
@keyframes ach-out { to { transform: translateX(120%); opacity: 0; } }

/* Gato ASCII de la terminal */
.catsay { display: block; white-space: pre; color: #e9dcff; }

/* Widget de frases */
.widget {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 300px;
  background: #fff; border: 2px solid var(--dk);
  box-shadow: 5px 5px 0 rgba(29, 20, 80, .35);
}
.widget-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  padding: 3px 4px 3px 8px;
  background: linear-gradient(90deg, var(--pink), var(--title-b));
  color: #fff; font: 600 13px var(--font-ui);
  cursor: grab; user-select: none; touch-action: none;
}
.widget.dragging { opacity: .9; }
.widget.dragging .widget-bar { cursor: grabbing; }
.w-btn { width: 22px; height: 20px; padding: 0; margin-left: 2px; background: var(--face); border: 2px solid; border-color: var(--hi) var(--dk) var(--dk) var(--hi); color: var(--ink); font-size: 11px; cursor: pointer; }
.widget blockquote { margin: 0; padding: 12px 14px 10px; }
.w-text { min-height: 3.6em; margin: 0 0 6px; font: 19px/1.25 var(--font-term); color: var(--ink); }
.w-text.typing::after { content: '▌'; color: var(--accent); animation: blink .8s steps(2) infinite; }
.w-author { font-size: 12px; color: var(--muted); text-align: right; }
@media (max-width: 720px) { .widget { display: none; } }

/* Salvapantallas */
.saver { position: fixed; inset: 0; z-index: 7000; background: #0b0920; cursor: none; overflow: hidden; }
.saver canvas { position: absolute; inset: 0; }
.saver-logo {
  position: absolute; left: 0; top: 0;
  font: 700 clamp(36px, 6vw, 72px)/1 var(--font-ui);
  text-shadow: 3px 3px 0 var(--dk), 0 0 24px currentColor;
  transition: color .3s;
}
.saver-logo b { color: #fff; }
.saver-cats { position: absolute; left: 0; right: 0; bottom: 24px; height: 80px; }
.saver-cats img { position: absolute; bottom: 0; left: 0; image-rendering: pixelated; }
.saver-hint { position: absolute; left: 0; right: 0; bottom: 4px; margin: 0; text-align: center; color: #6b62a0; font: 16px var(--font-term); }

/* Lluvia del código Konami */
.rain { position: fixed; inset: 0; z-index: 6500; pointer-events: none; overflow: hidden; }
.rain span, .rain img { position: absolute; top: -60px; animation: fall linear forwards; image-rendering: pixelated; }
.rain-title {
  position: absolute; top: 30%; left: 0; right: 0; margin: 0; text-align: center;
  font: 700 clamp(28px, 5vw, 56px) var(--font-ui); color: var(--yellow);
  text-shadow: 3px 3px 0 var(--dk), 0 0 20px var(--pink);
  animation: pop .4s ease-out, fade 6s forwards;
}
@keyframes fall { to { transform: translateY(calc(100vh + 120px)) rotate(360deg); } }
@keyframes fade { 80% { opacity: 1; } 100% { opacity: 0; } }

/* Habilidades */
.sysinfo { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.sysinfo > svg { flex: none; width: 64px; height: 64px; }
.sysinfo dl { display: grid; grid-template-columns: auto 1fr; gap: 0 14px; margin: 0; font-size: 13px; }
.sysinfo dt { color: var(--muted); }
.sysinfo dd { margin: 0; font-weight: 500; }
.group {
  margin: 0 0 14px; padding: 10px 14px 14px;
  border: 2px groove var(--line);
}
.group legend { padding: 0 6px; color: var(--accent); font: 600 15px var(--font-ui); }

/* Contacto */
.contact-hero { display: flex; gap: 14px; align-items: flex-start; }
.contact-hero svg { flex: none; width: 52px; height: 52px; }
.email-field { display: flex; gap: 6px; margin: 14px 0 4px; }
.email-field code {
  flex: 1; display: flex; align-items: center;
  padding: 6px 10px;
  background: #fff;
  border: 2px solid; border-color: var(--sh) var(--hi) var(--hi) var(--sh);
  font-size: 14px; word-break: break-all;
}
.contact .muted { margin: 14px 0 0; }

/* Papelera */
.file-list { list-style: none; margin: 0 0 14px; padding: 0; }
.file-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 6px; border-bottom: 1px dotted var(--line);
  color: var(--muted); text-decoration: line-through;
}
.file-list svg { flex: none; width: 24px; height: 24px; opacity: .6; }
.file-list small { margin-left: auto; font-size: 11.5px; text-decoration: none; }

/* ---------- Terminal ---------- */

.window-body.term {
  padding: 12px 14px;
  background: var(--term-bg);
  color: var(--term-fg);
  border-color: #000 var(--sh) var(--sh) #000;
  font: 21px/1.2 var(--font-term);
  scrollbar-color: var(--accent) var(--term-bg);
}
.term-row { white-space: pre-wrap; word-break: break-word; min-height: 1.2em; }
.term-row.indent { padding-left: 1ch; }
.term a { color: var(--term-acc); }
.term b { color: #fff; font-weight: normal; }
.term-line { display: flex; gap: 1ch; }
.term-in {
  flex: 1; min-width: 0; padding: 0;
  background: transparent; border: 0; outline: 0;
  color: #fff; font: inherit;
  caret-color: var(--term-ok);
}
.c-acc { color: var(--term-acc); }
.c-ok { color: var(--term-ok); }
.c-err { color: var(--term-err); }
.c-dim { color: var(--term-dim); }
.c-lil { color: #b79cf5; }
.c-today { background: var(--term-fg); color: var(--term-bg); }
.neofetch { display: flex; gap: 2ch; white-space: pre; overflow-x: auto; }
.swatch { display: inline-block; width: 1.4em; height: .9em; margin-right: 2px; vertical-align: middle; }

/* ---------- Barra de tareas ---------- */

.taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  height: var(--tb);
  display: flex; align-items: center; gap: 6px;
  padding: 5px 5px 4px;
  background: var(--face);
  border-top: 2px solid var(--hi);
  box-shadow: 0 -1px 0 var(--sh), inset 0 1px 0 var(--face-lt);
  font-family: var(--font-ui);
}
.start-btn {
  flex: none; height: 100%;
  display: flex; align-items: center; gap: 6px;
  padding: 0 12px 0 8px;
  font: 700 16px var(--font-ui);
}
.start-btn svg { width: 22px; height: 22px; }

.task-list { flex: 1; min-width: 0; height: 100%; display: flex; gap: 4px; overflow: hidden; }
.task {
  flex: 0 1 190px; min-width: 0; height: 100%;
  display: flex; align-items: center; gap: 6px;
  padding: 0 8px;
  font: 14px var(--font-ui);
  text-align: left;
}
.task svg { flex: none; width: 20px; height: 20px; }
.task span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.task[aria-pressed="true"] {
  background: repeating-conic-gradient(var(--face-lt) 0 25%, var(--face) 0 50%) 0 0 / 4px 4px;
  font-weight: 600;
}

.quick-btn {
  flex: none; height: 100%;
  display: flex; align-items: center; gap: 6px;
  padding: 0 12px 0 8px;
  background: var(--yellow);
  font: 600 15px var(--font-ui);
}
.quick-btn svg { width: 20px; height: 20px; }

.tray {
  flex: none; height: 100%;
  display: flex; align-items: center; gap: 4px;
  padding: 0 10px 0 4px;
  border: 2px solid; border-color: var(--sh) var(--hi) var(--hi) var(--sh);
  font-size: 15px;
}
.tray-btn {
  padding: 2px 8px;
  background: none; border: 0; cursor: pointer;
  font: 600 14px var(--font-ui);
}
.tray-btn:hover { background: var(--face-lt); }
#clock { min-width: 42px; text-align: right; }

/* ---------- Menú Inicio ---------- */

.start-menu {
  position: fixed; left: 4px; bottom: calc(var(--tb) - 2px); z-index: 1001;
  display: flex; width: 280px;
  padding: 3px;
  background: var(--face);
  border: 2px solid; border-color: var(--hi) var(--dk) var(--dk) var(--hi);
  box-shadow: inset -2px -2px var(--sh), 6px 6px 0 rgba(29, 20, 80, .3);
}
.start-banner {
  width: 36px;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 10px 0;
  background: linear-gradient(0deg, var(--title-a), var(--title-b));
}
.start-banner span {
  writing-mode: vertical-rl; transform: rotate(180deg);
  color: #fff; font: 700 24px var(--font-ui); letter-spacing: .04em;
}
.start-banner b { color: #ffe6a6; }
/* Altura máxima fija: aunque se añadan apps, el menú no crece más; el resto se ve con scroll */
.start-menu { max-height: min(560px, calc(100vh - var(--tb) - 6px)); }
.start-user { position: sticky; top: -2px; z-index: 1; background: linear-gradient(90deg, #cfc2f3, var(--face)); }
.start-list { flex: 1; list-style: none; margin: 0; padding: 2px 0 2px 3px; overflow-y: auto; scrollbar-width: thin; }
.start-item {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 5px 10px;
  background: none; border: 0; cursor: pointer;
  font: 16px var(--font-ui); text-align: left;
}
.start-item svg { flex: none; width: 26px; height: 26px; }
.start-item:hover, .start-item:focus-visible { background: var(--title-a); color: #fff; outline: none; }
.start-sep { height: 0; margin: 3px 2px; border-top: 1px solid var(--sh); border-bottom: 1px solid var(--hi); }

/* ---------- Apagado ---------- */

.shutdown {
  position: fixed; inset: 0; z-index: 6000;
  width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 24px;
  background: #0b0920; border: 0; cursor: pointer;
  color: #e2d4ff; font: 30px/1.3 var(--font-term); text-align: center;
}
.shutdown .blink { color: #8a80b8; font-size: 22px; animation: blink 1.1s steps(2) infinite; }

/* ---------- Modo rápido (CV) ---------- */

.quick {
  position: fixed; inset: 0; z-index: 4000;
  overflow: auto;
  padding: 0 16px 56px;
  background:
    radial-gradient(circle at 1px 1px, rgba(106, 79, 216, .18) 1px, transparent 0) 0 0 / 18px 18px,
    #efe9ff;
  font-family: var(--font-sans);
  color: var(--ink);
}
.quick-bar {
  position: sticky; top: 0; z-index: 1;
  max-width: 900px; margin: 0 auto;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 14px 0;
  background: #efe9ff;
}
.quick-bar-right { display: flex; gap: 8px; }
.cv {
  max-width: 900px; margin: 0 auto;
  background: #fff;
  border: 2px solid var(--dk);
  box-shadow: 8px 8px 0 var(--accent);
}
.cv-head {
  display: flex; align-items: center; gap: 24px;
  padding: 32px 40px 28px;
  background: linear-gradient(100deg, #cdb8fb, #aebcf8);
  border-bottom: 2px solid var(--dk);
}
.cv-head h1 {
  margin: 0;
  color: #1e2a6e;
  font: 700 clamp(30px, 5vw, 46px)/1.05 var(--font-ui); letter-spacing: .02em;
}
.cv-head h1:focus { outline: none; }
.cv-role { margin: 8px 0 14px; font-size: 18px; font-weight: 500; }
.cv-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; font-size: 14.5px; }
.cv-meta a { color: var(--ink); }
.cv-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; }
.cv-main { padding: 30px 40px; }
.cv-side { padding: 30px 28px; background: #f7f3ff; border-left: 2px dashed var(--line); }
.cv h2 {
  margin: 0 0 12px;
  color: var(--accent);
  font: 600 13px var(--font-mono); letter-spacing: .14em; text-transform: uppercase;
}
.cv section + section { margin-top: 28px; }
.cv p { margin: 0 0 10px; font-size: 15px; line-height: 1.6; }
.cv-job { margin-bottom: 20px; }
.cv-job h3 { margin: 0; font-size: 16.5px; font-weight: 600; }
.cv-job .meta { margin: 2px 0 6px; color: var(--muted); font-size: 14px; }
.cv-job ul { margin: 0; padding-left: 18px; font-size: 14.5px; line-height: 1.55; }
.cv-job li { margin-bottom: 3px; }
.cv .chips li { font-size: 13px; box-shadow: 2px 2px 0 var(--line); border-width: 1.5px; }
.plain { list-style: none; margin: 0; padding: 0; font-size: 14.5px; line-height: 1.8; }

/* ---------- Sin JavaScript ---------- */

.noscript {
  position: fixed; inset: 0; z-index: 9000;
  padding: 40px 24px;
  background: #efe9ff;
  font-family: var(--font-sans);
}

/* ---------- Móvil ---------- */

/* Tablets y ventanas estrechas: los iconos se colocan en rejilla arriba, como en móvil,
   para que no invadan el logo ni se amontonen en una sola columna */
@media (max-width: 1000px) {
  .icons {
    left: 0; right: 0; top: 10px; bottom: auto;
    grid-auto-flow: row;
    grid-template-rows: none;
    grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
    justify-items: center;
  }
  /* 116px para que quepan en una línea nombres largos como "Herramientas" */
  .d-icon { width: 116px; }
  /* Con los iconos arriba, la frase del día se va abajo para no taparlos */
  .widget { top: auto; bottom: 12px; right: 12px; width: min(300px, 60vw); }
}

@media (max-width: 720px) {
  .boot { padding: 20px 18px; font-size: 17px; }
  .boot-skip { left: 18px; }
  .icons {
    left: 0; right: 0; top: 10px; bottom: auto;
    grid-auto-flow: row;
    grid-template-rows: none;
    grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
    justify-items: center;
  }
  /* 116px para que quepan en una línea nombres largos como "Herramientas" */
  .d-icon { width: 116px; }
  .sun { top: 74%; width: 62vmin; }
  .floor { top: 74%; }
  .wordmark { top: 74%; }
  .wm-role { font-size: 13px; white-space: normal; max-width: 90vw; }
  .task { flex: 0 0 auto; }
  .task span, .quick-btn span { display: none; }
  .start-btn { padding: 0 10px 0 8px; }
  .window-body { padding: 14px; }
  .addr-bar { margin: -14px -14px 14px; }
  .window-body.term { font-size: 18px; }
  .window-body.frame { padding: 0; }
  .cal { grid-template-columns: 1fr; }
  .ws { grid-template-columns: 1fr; }
  .ws-words { columns: 3; }
  .window-body.notes-body { padding: 0; }

  .cv-grid { grid-template-columns: 1fr; }
  .cv-side { border-left: 0; border-top: 2px dashed var(--line); }
  .cv-head, .cv-main, .cv-side { padding: 24px 20px; }
  .cv-head { gap: 16px; }
  .cv-portrait { width: 76px; height: 76px; }
}

@media (max-width: 400px) {
  .start-btn span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Impresión: sólo el CV ---------- */

@media print {
  @page { margin: 12mm; }
  body { overflow: visible; background: #fff; }
  body > *:not(#quick) { display: none !important; }
  .quick { position: static; padding: 0; overflow: visible; background: #fff; }
  .no-print { display: none !important; }
  .cv { border: 0; box-shadow: none; }
  .cv-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cv-side { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cv-job, .cv section { break-inside: avoid; }
}
