/* ============================================================
   OS DEMO — hoja de estilos cartoon
   Tipografías autoalojadas: Baloo 2 (display) + Nunito (texto)
   ============================================================ */

:root {
  --ink: #17171f;
  --paper: #fffdf6;
  --paper-2: #f4eee0;
  --sun: #ffd93d;
  --sun-soft: #fff3b8;
  --berry: #ff5d6c;
  --leaf: #6bcb77;
  --sky: #aee7ff;
  --blue: #4d96ff;
  --purple: #b983ff;
  --pink: #ff7eb6;
  --teal: #4ecdc4;
  --orange: #ff9f1c;
  --font-display: 'Baloo 2', 'Trebuchet MS', sans-serif;
  --font-body: 'Nunito', 'Trebuchet MS', sans-serif;
  --shadow: 6px 6px 0 rgba(23, 23, 31, 0.14);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--ink);
  background: var(--paper-2);
}

button { font-family: inherit; color: inherit; }

::selection { background: var(--sun); color: var(--ink); }

*::-webkit-scrollbar { width: 12px; height: 12px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--ink);
  border-radius: 999px;
  border: 3px solid var(--paper);
}

/* ---------------- Escritorio y capa de ventanas ---------------- */

#desktop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
}

#window-layer {
  position: fixed;
  left: 0; right: 0; top: 0;
  bottom: 96px; /* por encima de la barra de tareas */
  z-index: 1;
}

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

.window {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 300px;
  min-height: 200px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.window--new { animation: winpop 0.26s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes winpop {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to { opacity: 1; transform: none; }
}

.window--min { display: none; }

.window--max {
  left: 6px !important;
  top: 6px !important;
  right: 6px;
  bottom: 6px;
  width: auto !important;
  height: auto !important;
  border-radius: 16px;
}

.window--active { box-shadow: 9px 9px 0 rgba(23, 23, 31, 0.22); }

.win-titlebar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  background: var(--paper-2);
  border-bottom: 3px solid var(--ink);
  cursor: grab;
  user-select: none;
}
.win-titlebar:active { cursor: grabbing; }

.win-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.win-title-icon { width: 22px; height: 22px; flex: none; }

.window[data-app="files"] .win-titlebar { background: #eaf2ff; }
.window[data-app="calculator"] .win-titlebar { background: #f3ecff; }
.window[data-app="snake"] .win-titlebar { background: #e9f9ec; }
.window[data-app="tasks"] .win-titlebar { background: #fff0f6; }
.window[data-app="wallpapers"] .win-titlebar { background: #e5fbf6; }
.window[data-app="viewer"] .win-titlebar { background: #fff4e0; }
.window[data-app="bloc"] .win-titlebar { background: #fdf3d7; }

.win-title-dirty { color: var(--berry); font-weight: 900; }

.win-buttons { display: flex; gap: 6px; flex: none; }

.win-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  transition: transform 0.1s;
}
.win-btn:hover { transform: translateY(-2px) scale(1.05); }
.win-btn:active { transform: translateY(1px); }
.win-btn--min { background: var(--sun); }
.win-btn--max { background: var(--leaf); }
.win-btn--close { background: var(--berry); color: #fff; }

.win-body {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

/* Los contenedores de cada app llenan la ventana */
.fm, .calc, .snake, .tasks, .wp, .viewer-wrap, .bloc {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* ---------------- Botones genéricos ---------------- */

.btn {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 14px;
  padding: 9px 18px;
  border-radius: 14px;
  border: 3px solid var(--ink);
  background: #fff;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn--primary { background: var(--sun); }
.btn--danger { background: var(--berry); color: #fff; }
.btn--soft { background: var(--paper); }

.fm-tool {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 12.5px;
  padding: 6px 11px;
  border-radius: 12px;
  border: 2.5px solid var(--ink);
  background: #fff;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.08s, box-shadow 0.08s;
}
.fm-tool:hover { transform: translateY(-1px); }
.fm-tool:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.fm-tool--on { background: var(--ink); color: var(--paper); }

/* ---------------- Splash ---------------- */

#splash {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 217, 61, 0.55), transparent 34%),
    linear-gradient(180deg, #8fdcff 0%, #cfeeff 55%, #fff3c0 100%);
  cursor: pointer;
  transition: opacity 0.5s, transform 0.5s;
}

.splash--done {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

.splash-logo { text-align: center; }

.splash-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 72px;
  line-height: 1;
  color: #fff;
  letter-spacing: 2px;
  text-shadow:
    -3px -3px 0 var(--ink), 3px -3px 0 var(--ink),
    -3px 3px 0 var(--ink), 3px 3px 0 var(--ink),
    0 7px 0 var(--ink);
  transform: rotate(-3deg);
}

.splash-sub {
  display: inline-block;
  margin-top: 14px;
  font-weight: 900;
  font-size: 16px;
  background: var(--sun);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 6px 18px;
  box-shadow: 4px 4px 0 rgba(23, 23, 31, 0.25);
  transform: rotate(2deg);
}

.splash-bar {
  position: relative;
  width: 280px;
  height: 26px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}

.splash-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--berry), var(--sun), var(--leaf));
  animation: splashfill 2.2s linear forwards;
}
@keyframes splashfill { to { width: 100%; } }

.splash-face {
  position: absolute;
  top: -34px;
  left: 0;
  font-size: 30px;
  animation: splashface 1.1s ease-in-out infinite;
}
@keyframes splashface {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-7px) rotate(8deg); }
}

.splash-hint {
  font-weight: 800;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.85);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 5px 14px;
}

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

#taskbar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  height: 78px;
  z-index: 5000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: var(--sun);
  border: 4px solid var(--ink);
  border-radius: 26px;
  box-shadow: 0 6px 0 rgba(23, 23, 31, 0.18);
}

.start-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 8px;
  border-radius: 18px;
  border: 3px solid var(--ink);
  background: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}
.start-btn img { width: 32px; height: 32px; }
.start-btn:hover { transform: translateY(-2px) rotate(-1deg); }
.start-btn--open { background: var(--sun-soft); }

#quick-launch { display: flex; gap: 8px; margin-left: 4px; }

.slot {
  width: 66px;
  height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s;
}
.slot-icon { width: 27px; height: 27px; }
.slot-label { font-size: 10.5px; font-weight: 800; line-height: 1; }
.slot:hover { transform: translateY(-3px) rotate(-1.5deg); }
.slot--running { background: var(--sun-soft); }
.slot--min { opacity: 0.55; }
.slot--active {
  background: var(--sun-soft);
  transform: translateY(-4px);
  box-shadow: 0 5px 0 rgba(23, 23, 31, 0.25);
}

#win-slots { display: flex; gap: 6px; margin-left: 4px; overflow: hidden; }

.win-slot {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 170px;
  padding: 8px 12px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.win-slot img { width: 18px; height: 18px; flex: none; }
.win-slot:hover { transform: translateY(-2px); }
.win-slot--active { background: var(--sun-soft); box-shadow: 0 4px 0 rgba(23, 23, 31, 0.25); }

#clock {
  margin-left: auto;
  padding: 10px 16px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 1px;
}

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

.start-menu {
  display: none;
  position: fixed;
  left: 18px;
  bottom: 104px;
  z-index: 6000;
  width: 264px;
  padding: 12px;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 22px;
  box-shadow: 8px 8px 0 rgba(23, 23, 31, 0.2);
}

.start-menu.open { display: block; animation: winpop 0.18s ease-out; }

.start-menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 12px;
}

.start-menu-logo {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--sun);
  border: 3px solid var(--ink);
  border-radius: 50%;
}
.start-menu-logo img { width: 32px; height: 32px; }

.start-menu-name { font-family: var(--font-display); font-weight: 800; font-size: 16px; line-height: 1.1; }
.start-menu-tag { font-size: 11px; font-weight: 700; color: #7a7460; }

.start-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 14px;
  border: 2.5px solid transparent;
  background: none;
  font-size: 14px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.12s, background 0.12s;
}
.start-item:hover {
  border-color: var(--ink);
  background: #fff;
  transform: translateX(3px) rotate(-0.5deg);
}
.start-item-icon { width: 27px; height: 27px; flex: none; }

.start-sep {
  height: 3px;
  margin: 8px 6px;
  background: rgba(23, 23, 31, 0.14);
  border-radius: 99px;
}

.start-reset { border-style: dashed; }
.start-reset:hover { background: #ffe3e6; }
.start-reset-icon { width: 27px; text-align: center; flex: none; }

/* ---------------- Diálogos cartoon ---------------- */

.os-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(23, 23, 31, 0.45);
}

.os-dialog {
  width: min(92vw, 400px);
  padding: 18px 18px 16px;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 24px;
  box-shadow: 10px 10px 0 rgba(23, 23, 31, 0.25);
  animation: winpop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.os-dialog-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.15;
}

.os-dialog-text {
  margin: 10px 0 14px;
  font-size: 14px;
  font-weight: 700;
  color: #4c4636;
}

.os-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.os-prompt-label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 800;
}

.os-prompt-input {
  width: 100%;
  margin-bottom: 14px;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 12px;
}
.os-prompt-input:focus { outline: 3px dashed var(--purple); outline-offset: 2px; }

/* ---------------- Toast ---------------- */

.os-toast {
  position: fixed;
  left: 50%;
  bottom: 112px;
  z-index: 7000;
  padding: 10px 22px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  opacity: 0;
  transform: translateX(-50%) translateY(18px);
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
}
.os-toast--show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- App: Archivos ---------------- */

.fm { background: #f2f7ff; }

.fm-toolbar {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  background: #eaf2ff;
  border-bottom: 3px solid var(--ink);
}

.fm-crumbs {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
}

.crumb {
  padding: 4px 11px;
  border-radius: 999px;
  border: 2px solid transparent;
  background: none;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}
.crumb:hover { border-color: var(--ink); background: #fff; }
.crumb--current { background: var(--ink); color: var(--paper); cursor: default; }
.crumb--current:hover { border-color: transparent; background: var(--ink); }
.crumb-sep { font-size: 14px; font-weight: 900; color: #b3ab93; }
.crumb--up { margin-left: auto; background: #fff; border: 2px solid var(--ink); }
.crumb--disabled { opacity: 0.4; cursor: default; }

.fm-grid {
  flex: 1;
  overflow: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  align-content: start;
}

.fm-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  background: rgba(255, 255, 255, 0.6);
  border: 3px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s;
}
.fm-item:hover { transform: translateY(-3px) rotate(-1deg); border-color: #a9c8ff; }
.fm-item--selected { border-color: var(--ink); background: #fff; box-shadow: 3px 3px 0 rgba(23, 23, 31, 0.15); }
.fm-item-icon { width: 44px; height: 44px; }
.fm-item-name {
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  word-break: break-word;
}

.fm-empty {
  grid-column: 1 / -1;
  padding: 40px 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  color: #8b8570;
}

/* ---------------- App: Visor ---------------- */

.viewer-wrap { background: #fff; padding: 16px; overflow: auto; }

.viewer-title {
  margin: 0 0 12px;
  padding-bottom: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  border-bottom: 3px dashed #e8e0c8;
}

.viewer-text {
  padding: 12px 14px;
  background: var(--sun-soft);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.viewer-img {
  display: block;
  width: 100%;
  background: repeating-conic-gradient(#f2ede0 0% 25%, #fff 0% 50%) 0 0 / 24px 24px;
  border: 3px solid var(--ink);
  border-radius: 14px;
}

.viewer-empty {
  padding: 44px 14px;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  color: #8b8570;
}

/* ---------------- App: Bloc de notas ---------------- */

.bloc { background: #fff; }

.bloc-toolbar {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: var(--sun-soft);
  border-bottom: 3px solid var(--ink);
}

.bloc-toolbar .btn { padding: 7px 14px; font-size: 13px; border-radius: 12px; }

/* Guardar resaltado mientras hay cambios sin guardar */
.btn--dirty { background: var(--berry); color: #fff; }
.btn--dirty:hover { background: var(--berry); }

.bloc-title {
  margin: 12px 12px 0;
  padding-bottom: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  border-bottom: 3px dashed #e8e0c8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bloc-editor {
  flex: 1;
  min-height: 0;
  width: calc(100% - 24px);
  margin: 10px 12px 12px;
  padding: 12px 14px;
  resize: none;
  font-family: ui-monospace, 'Cascadia Mono', 'Courier New', monospace;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
  white-space: pre-wrap;
}
.bloc-editor:focus { outline: 3px dashed var(--purple); outline-offset: 2px; }

/* ---------------- App: Calculadora ---------------- */

.calc { background: #f3ecff; }

.calc-top {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px 12px 4px;
}

.calc-memory {
  align-self: flex-start;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 800;
  color: #6f5a9e;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
}
.calc-memory--on { background: var(--sun-soft); color: var(--ink); }

.calc-display {
  padding: 8px 14px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 16px;
  text-align: right;
  box-shadow: inset 0 -5px 0 rgba(23, 23, 31, 0.06);
}

.calc-expr {
  min-height: 18px;
  font-size: 13px;
  font-weight: 700;
  color: #a295c2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calc-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 36px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calc-value--error { color: var(--berry); }

.calc-history-toggle { align-self: flex-end; }

.calc-keys {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 8px 12px 6px;
  align-content: stretch;
}

.calc-key {
  border-radius: 16px;
  border: 3px solid var(--ink);
  background: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.07s, box-shadow 0.07s;
}
.calc-key:hover { transform: translateY(-1px); }
.calc-key:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.calc-key--fn { background: #e9f6ee; font-size: 16px; }
.calc-key--mem { background: var(--sun-soft); font-size: 15px; }
.calc-key--op { background: #ffe1e4; font-size: 22px; }
.calc-key--eq { background: var(--sun); font-size: 24px; }

.calc-history {
  flex: none;
  max-height: 42%;
  overflow: auto;
  padding: 10px 12px;
  background: #fff;
  border-top: 3px solid var(--ink);
  display: none;
}
.calc-history--open { display: block; }

.calc-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.calc-history-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}

.calc-history-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.calc-history-item {
  margin-bottom: 4px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  word-break: break-all;
  background: #faf7ff;
  border: 2px solid #e3d9ff;
  border-radius: 10px;
}
.calc-history-empty {
  padding: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #a79fc0;
}

/* ---------------- App: Snake ---------------- */

.snake { background: #e9f9ec; padding: 12px; gap: 10px; }

.snake-hud {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.snake-score, .snake-record {
  padding: 5px 14px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 800;
}
.snake-record { background: var(--sun-soft); }

.snake-canvas-wrap {
  flex: none;
  align-self: center;
  max-width: 100%;
  background: #f4fcef;
  border: 4px solid var(--ink);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 5px 5px 0 rgba(23, 23, 31, 0.12);
}
.snake-canvas-wrap canvas { display: block; max-width: 100%; height: auto; }

.snake-controls { flex: none; display: flex; justify-content: center; gap: 10px; }

.snake-btn {
  padding: 8px 16px;
  border-radius: 14px;
  border: 3px solid var(--ink);
  background: var(--leaf);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.07s, box-shadow 0.07s;
}
.snake-btn:hover { transform: translateY(-1px); }
.snake-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.snake-btn + .snake-btn { background: #fff; }

.snake-status {
  flex: none;
  min-height: 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: #3f7a43;
}

/* ---------------- App: Tareas ---------------- */

.tasks { background: #fff; padding: 12px; gap: 10px; }

.task-form {
  flex: none;
  display: grid;
  grid-template-columns: 1fr auto 150px auto;
  gap: 8px;
  padding: 10px;
  background: #fff0f6;
  border: 3px solid var(--ink);
  border-radius: 16px;
}

.task-input, .task-tags, .task-prio-select {
  padding: 9px 11px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 12px;
  min-width: 0;
}
.task-input:focus, .task-tags:focus, .task-prio-select:focus {
  outline: 3px dashed var(--pink);
  outline-offset: 1px;
}

.task-add {
  padding: 8px 15px;
  border-radius: 12px;
  border: 3px solid var(--ink);
  background: var(--pink);
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.07s, box-shadow 0.07s;
}
.task-add:hover { transform: translateY(-1px); }
.task-add:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }

.task-bar {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.task-filter {
  padding: 5px 13px;
  border-radius: 999px;
  border: 2.5px solid var(--ink);
  background: #fff;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}
.task-filter:hover { background: var(--sun-soft); }
.task-filter--active { background: var(--ink); color: var(--paper); }
.task-filter--active:hover { background: var(--ink); }

.task-chips { display: flex; flex-wrap: wrap; gap: 5px; }

.task-chip {
  padding: 4px 11px;
  border-radius: 999px;
  border: 2px solid #ffb3cf;
  background: #fff;
  color: #b23a6e;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.task-chip:hover { background: #fff0f6; }
.task-chip--active { border-color: var(--ink); background: var(--pink); color: #fff; }
.task-chip--clear { border-style: dashed; color: #8b8570; border-color: #d8d2bf; background: #fff; }

.task-count {
  margin-left: auto;
  padding: 4px 11px;
  background: #fff0f6;
  border: 2px solid #ffb3cf;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  color: #a04a72;
}

.task-list {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 16px;
  transition: transform 0.1s;
}
.task-item:hover { transform: translateX(2px); }
.task-item--done { opacity: 0.62; border-style: dashed; background: #faf9f4; }

.task-check {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--berry);
  cursor: pointer;
}

.task-main { flex: 1; min-width: 0; }

.task-text {
  font-size: 14.5px;
  font-weight: 800;
  word-break: break-word;
}
.task-item--done .task-text { text-decoration: line-through; color: #8b8570; }

.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 5px; }

.task-prio-tag {
  padding: 2px 9px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  font-size: 11px;
  font-weight: 800;
}
.task-prio-tag--alta { background: #ffd7d7; }
.task-prio-tag--media { background: #fff0c2; }
.task-prio-tag--baja { background: #d9f3e1; }

.task-tag-mini {
  padding: 2px 9px;
  border-radius: 999px;
  border: 2px solid #ffb3cf;
  background: #fff0f6;
  color: #b23a6e;
  font-size: 11px;
  font-weight: 800;
}

.task-del {
  padding: 2px 6px;
  border: none;
  background: none;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.1s, transform 0.1s;
}
.task-del:hover { opacity: 1; transform: scale(1.2) rotate(-6deg); }

.task-empty {
  padding: 28px 12px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 800;
  color: #b08a9c;
  border: 3px dashed #ffb3cf;
  border-radius: 16px;
}

/* ---------------- App: Fondos ---------------- */

.wp { background: #e5fbf6; padding: 12px; gap: 12px; }

.wp-head { flex: none; }

.wp-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.15;
}

.wp-sub {
  margin-top: 3px;
  font-size: 12.5px;
  font-weight: 700;
  color: #2e7d74;
}

.wp-grid {
  flex: 1;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  align-content: start;
}

.wp-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 4px solid var(--ink);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  text-align: left;
  box-shadow: 5px 5px 0 rgba(23, 23, 31, 0.12);
  transition: transform 0.15s, box-shadow 0.15s;
}
.wp-card:hover { transform: translateY(-4px) rotate(-1deg); }
.wp-card--active {
  outline: 4px solid var(--leaf);
  outline-offset: 2px;
  box-shadow: 5px 5px 0 rgba(107, 203, 119, 0.4);
}

.wp-card-frame {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 3px solid var(--ink);
  background: #fff;
}
.wp-card-img { display: block; width: 100%; height: 100%; object-fit: cover; }

.wp-card-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 10px;
}
.wp-card-name { font-size: 13px; font-weight: 800; }
.wp-card--active .wp-card-bar { background: var(--leaf); }

.wp-card-check {
  width: 22px;
  height: 22px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  background: #cfc9b8;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  opacity: 0.45;
}
.wp-card-check--on { opacity: 1; background: var(--sun); color: var(--ink); }

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

.noscrypt {
  position: fixed;
  left: 50%;
  top: 38%;
  transform: translateX(-50%);
  z-index: 9500;
  width: min(90vw, 430px);
  padding: 22px 28px;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 20px;
  box-shadow: 8px 8px 0 rgba(23, 23, 31, 0.2);
}

/* ---------------- Pantallas pequeñas ---------------- */

@media (max-width: 760px) {
  #taskbar { left: 8px; right: 8px; bottom: 8px; height: 66px; border-radius: 20px; gap: 7px; }
  .start-btn { padding: 6px 10px 6px 7px; }
  .start-btn span { display: none; }
  .slot { width: 52px; height: 50px; }
  .slot-label { display: none; }
  .start-menu { bottom: 88px; width: min(86vw, 264px); }
  .window { min-width: 0; min-height: 180px; }
  #window-layer { bottom: 84px; }
  .task-form { grid-template-columns: 1fr 1fr; }
}

/* ---------------- Movimiento reducido ---------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
