@font-face { font-family: 'Inter Tight'; src: url(fonts/inter-tight.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Inter'; src: url(fonts/inter.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url(fonts/caveat.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  --ui: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', system-ui, sans-serif;
  --display: 'Inter Tight', 'Inter', sans-serif;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #a1a1a6;
  --line: rgba(0, 0, 0, .09);
  --win: rgba(251, 251, 250, .95);
  --paper: #fffdf8;
  --accent: #0a84ff;
  --danger: #d70015;
  --mb: 28px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.2, .9, .3, 1.25);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  font: 13px/1.4 var(--ui);
  color: var(--ink);
  background: #e6e5e1;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
a { color: inherit; }
.muted { color: var(--ink-2); }
.small { font-size: 12px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.noscript { position: fixed; inset: 40% 0 auto; text-align: center; font-size: 16px; }

/* ---------- Fondo (el de Hurtaldo; el desenfoque de abajo va ya horneado en la imagen) ---------- */
#wallpaper { position: fixed; inset: 0; overflow: hidden; background: #777 url(fondo.webp) center / cover no-repeat; }
#wallpaper.photo::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 47.4%; pointer-events: none;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 40%); mask-image: linear-gradient(to bottom, transparent 0%, #000 40%);
}
#wallpaper::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(84, 84, 84, 0) 0%, #000 100%); opacity: .4; }

/* ---------- Barra de menús ---------- */
#menubar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--mb); z-index: 5000;
  display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 10px;
  background: rgba(20, 20, 20, .16); color: #fff;
  -webkit-backdrop-filter: blur(24px) saturate(1.5); backdrop-filter: blur(24px) saturate(1.5);
  font-size: 13px; text-shadow: 0 0 2px rgba(0, 0, 0, .15);
}
.mb-left, .mb-right { display: flex; align-items: center; gap: 2px; position: relative; }
.mb-right { gap: 14px; font-variant-numeric: tabular-nums; }
.mb-brand { font-weight: 700; background: none; border: 0; padding: 2px 9px; border-radius: 5px; cursor: default; }
.mb-brand:hover, .mb-brand[aria-expanded='true'] { background: rgba(255, 255, 255, .2); }
.mb-item { padding: 2px 9px; cursor: default; }
.mb-ic { height: 13px; width: auto; }
.menu {
  position: absolute; top: 25px; left: 0; min-width: 230px; padding: 5px; color: var(--ink); text-shadow: none;
  background: rgba(246, 246, 246, .84);
  -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8);
  border-radius: 9px; box-shadow: 0 10px 40px rgba(0, 0, 0, .2), 0 0 0 .5px rgba(0, 0, 0, .18);
}
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 4px 10px; border-radius: 5px; cursor: default; }
.menu button:hover { background: var(--accent); color: #fff; }
.menu hr { border: 0; height: 1px; background: rgba(0, 0, 0, .1); margin: 5px 9px; }

/* ---------- Escritorio ---------- */
#desktop { position: fixed; inset: var(--mb) 0 0 0; }
.icon {
  position: absolute; width: 136px; padding: 0; border: 0; background: none;
  display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; touch-action: none;
  animation: iconIn .55s var(--ease-spring) both; animation-delay: calc(var(--i) * 70ms + 150ms);
}
@keyframes iconIn { from { opacity: 0; transform: translateY(10px) scale(.85); } }
.icon.tidying { transition: left .5s var(--ease-out), top .5s var(--ease-out); }
.thumb-wrap { position: relative; display: block; padding: 12px; border-radius: 10px; border: 2px solid transparent; transition: background .18s ease, border-color .18s ease; }
.icon:hover .thumb-wrap, .icon.selected .thumb-wrap { background: rgba(0, 0, 0, .16); border-color: rgba(255, 255, 255, .2); }
.thumb {
  display: block; width: 80px; height: 52px; border-radius: 8px; overflow: hidden; background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2); box-shadow: 0 1px 6px rgba(0, 0, 0, .08), 0 10px 24px -10px rgba(0, 0, 0, .5);
  transition: transform .3s var(--ease-spring);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.icon:hover .thumb { transform: scale(1.04); }
.icon.dragging { z-index: 20; cursor: grabbing; }
.icon { -webkit-touch-callout: none; }
.icon.dragging .thumb { transform: scale(1.08); }
.icon .label {
  font-size: 15px; font-weight: 400; letter-spacing: -.03em; line-height: 1.3; color: #f7f7f7; text-align: center;
  padding: 3px 8px; border-radius: 5px; max-width: 136px; text-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: background .18s ease;
}
.icon:hover .label, .icon.selected .label { background: rgb(0, 102, 221); text-shadow: none; }
.icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.badge {
  position: absolute; right: 4px; top: 4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: #ff3b30; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3); animation: pop .4s var(--ease-spring) both .9s;
}
.badge[hidden] { display: none; }
.badge-lock { background: var(--ink); padding: 0; width: 19px; }
.badge-lock svg { width: 10px; height: 10px; }
@keyframes pop { from { transform: scale(0); } }
.prog { position: absolute; left: 21px; right: 21px; bottom: 20px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .28); overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; background: #fff; border-radius: 3px; transition: width 1s linear; }

/* ---------- Ventanas ---------- */
#windows { position: fixed; inset: 0; pointer-events: none; z-index: 100; }
.win {
  position: absolute; pointer-events: auto; display: flex; flex-direction: column; overflow: hidden;
  background: var(--win); border-radius: 12px; min-width: 320px; min-height: 200px;
  -webkit-backdrop-filter: blur(40px) saturate(1.8); backdrop-filter: blur(40px) saturate(1.8);
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .24), 0 24px 70px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .12);
  transition: left .35s var(--ease-out), top .35s var(--ease-out), width .35s var(--ease-out), height .35s var(--ease-out), box-shadow .2s;
}
.win.moving { transition: none; }
.win.inactive { box-shadow: 0 0 0 .5px rgba(0, 0, 0, .2), 0 14px 40px rgba(0, 0, 0, .18); }
.win.opening { animation: winIn .46s var(--ease-out) both; }
@keyframes winIn { from { opacity: 0; transform: translate(var(--dx, 0), var(--dy, 0)) scale(.12); } }
.win.closing { animation: winOut .2s ease-in both; }
.win.closing, .win.minimizing { pointer-events: none; }
@keyframes winOut { to { opacity: 0; transform: scale(.94); } }
.win.minimizing { transition: transform .38s cubic-bezier(.5, 0, .75, 0), opacity .38s ease-in; transform: translate(var(--dx, 0), var(--dy, 200px)) scale(.08); opacity: 0; }
.win.min { display: none; }
.win.max { left: 8px !important; top: calc(var(--mb) + 8px) !important; width: calc(100vw - 16px) !important; height: calc(100vh - var(--mb) - 132px) !important; }
.win-bar {
  position: relative; flex: none; height: 40px; display: flex; align-items: center; padding: 0 14px;
  border-bottom: .5px solid var(--line); background: rgba(246, 246, 244, .6); cursor: default; touch-action: none;
}
.win-title { position: absolute; left: 84px; right: 84px; text-align: center; font-weight: 600; pointer-events: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win.inactive .win-title { color: var(--ink-3); }
.tb-dots { display: flex; gap: 8px; z-index: 1; }
.tb-dots button { width: 12px; height: 12px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; cursor: default; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .2); }
.tb-dots svg { width: 8px; height: 8px; opacity: 0; transition: opacity .1s; }
.tb-dots:hover svg { opacity: .65; }
.tb-close { background: #ff5f57; }
.tb-min { background: #febc2e; }
.tb-max { background: #28c840; }
.win.inactive .tb-dots button { background: #d8d8d6; }
.win-back { display: none; }
.win-body { flex: 1; min-height: 0; overflow: auto; position: relative; user-select: text; -webkit-user-select: text; overscroll-behavior: contain; }
.win-body.locked-scroll { overflow: hidden; }
.win-resize { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; touch-action: none; }

.rich p { margin: 0 0 12px; }
.rich p:last-child { margin-bottom: 0; }
.rich a { color: var(--accent); }
.empty { text-align: center; color: var(--ink-2); padding: 48px 20px; font-size: 14px; }
.live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #34c759; margin-right: 7px; vertical-align: 1px; animation: live 2s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(52, 199, 89, .55); } 70%, 100% { box-shadow: 0 0 0 7px rgba(52, 199, 89, 0); } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  font-weight: 600; font-size: 14px; border: 0; border-radius: 10px; padding: 11px 16px;
  background: var(--ink); color: #fff; cursor: pointer; text-decoration: none; transition: transform .15s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-sm { width: auto; padding: 7px 13px; font-size: 13px; border-radius: 8px; }
.btn-ghost { background: rgba(0, 0, 0, .06); color: var(--ink); }
.field {
  width: 100%; font: inherit; font-size: 15px; padding: 11px 12px; border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, .14); background: #fff; outline: none; color: var(--ink);
}
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10, 132, 255, .2); }
.err { color: var(--danger); font-size: 12.5px; min-height: 1.2em; margin: 8px 0 0; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- Situación Millionaire ---------- */
.mm-hero {
  position: relative; height: 158px; display: flex; align-items: flex-end; gap: 16px; padding: 18px 22px; color: #fff;
  background: #0c0d0c center / cover no-repeat;
}
.mm-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, .7)); }
.mm-hero > * { position: relative; }
.mm-k { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; opacity: .75; font-weight: 600; }
.mm-hero h2 { font-family: var(--display); font-size: 36px; font-weight: 800; letter-spacing: -.045em; line-height: .95; margin: 2px 0 0; }
.mm-day { margin-left: auto; text-align: right; }
.mm-day span { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; opacity: .75; font-weight: 600; }
.mm-day b { font-family: var(--display); font-size: 48px; font-weight: 800; letter-spacing: -.05em; line-height: .9; font-variant-numeric: tabular-nums; }
.mm-sub { padding: 11px 22px; font-size: 12px; color: var(--ink-2); border-bottom: .5px solid var(--line); }
.mm-feed { list-style: none; margin: 0; padding: 0 22px 20px; }
.mm-feed li { display: grid; grid-template-columns: 58px 1fr; gap: 16px; padding: 18px 0; border-bottom: .5px solid var(--line); }
.mm-feed li:last-child { border-bottom: 0; }
.mm-d { font-size: 11px; color: var(--ink-2); line-height: 1.3; }
.mm-d b { display: block; font-family: var(--display); font-size: 24px; color: var(--ink); letter-spacing: -.04em; font-weight: 800; line-height: 1.05; }
.mm-t { font-size: 15px; font-weight: 650; margin: 0 0 5px; letter-spacing: -.01em; }
.mm .rich p { font-size: 14px; line-height: 1.6; }

/* ---------- La vida de Hurtaldo (Notas) ---------- */
.notes { display: grid; grid-template-columns: 250px 1fr; height: 100%; position: relative; }
.notes-list { background: rgba(245, 244, 239, .92); border-right: .5px solid var(--line); overflow: auto; padding-bottom: 12px; }
.notes-list h3 { font-size: 11px; font-weight: 600; color: var(--ink-2); margin: 14px 18px 6px; }
.note-row {
  display: block; width: calc(100% - 16px); margin: 0 8px 1px; text-align: left; background: none; border: 0;
  padding: 9px 10px; border-radius: 7px; cursor: default; position: relative;
}
.note-row + .note-row::before { content: ''; position: absolute; left: 10px; right: 10px; top: 0; height: .5px; background: var(--line); }
.note-row.active { background: #f9dc6b; }
.note-row.active::before, .note-row.active + .note-row::before { display: none; }
.note-row b { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-row b svg { flex: none; width: 10px; height: 10px; }
.note-row span { display: block; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.note-row time { color: var(--ink); margin-right: 5px; }
.notes-detail { overflow: auto; padding: 18px 40px 48px; background: var(--paper); }
.notes-date { text-align: center; font-size: 12px; color: var(--ink-3); margin-bottom: 20px; }
.notes-detail h1 { font-size: 27px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; margin: 0 0 14px; }
.notes-detail .rich p { font-size: 15.5px; line-height: 1.68; }
.notes-back { display: none; }
.fake i { display: block; height: 11px; border-radius: 6px; background: rgba(0, 0, 0, .09); margin: 0 0 13px; }
.fake i:first-child { height: 22px; width: 55%; margin-bottom: 22px; background: rgba(0, 0, 0, .14); }
.notes.locked .notes-detail > * { filter: blur(3px); }
.lock { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(255, 253, 248, .3); transition: opacity .45s, transform .45s var(--ease-out); }
.lock.unlocking { opacity: 0; transform: scale(1.04); }
.lock-card {
  width: min(360px, 100%); background: rgba(255, 255, 255, .97); border-radius: 16px; padding: 26px 24px 18px; text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .18), 0 0 0 .5px rgba(0, 0, 0, .08);
}
.lock-ic { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 13px; background: #f7c948; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(247, 201, 72, .45); }
.lock-ic svg { width: 22px; height: 22px; }
.lock-card h2 { font-size: 19px; margin: 0 0 6px; letter-spacing: -.015em; }
.lock-card > p { color: var(--ink-2); margin: 0 0 16px; font-size: 13.5px; line-height: 1.5; }
.check { display: flex; gap: 8px; text-align: left; font-size: 12px; line-height: 1.4; color: var(--ink-2); margin: 11px 2px 14px; align-items: flex-start; cursor: pointer; }
.check input { margin: 1px 0 0; accent-color: var(--ink); }
.lock-card small { display: block; margin-top: 4px; font-size: 11.5px; }

/* ---------- Próximo vídeo ---------- */
.vp { display: grid; grid-template-columns: 116px 1fr; gap: 20px; padding: 22px 24px; }
.vp-thumb { width: 116px; aspect-ratio: 16 / 10; border-radius: 8px; object-fit: cover; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .15), 0 6px 16px -4px rgba(0, 0, 0, .3); }
.vp-k { font-size: 12px; color: var(--ink-2); }
.vp-title { font-size: 16px; font-weight: 650; margin: 2px 0 14px; letter-spacing: -.01em; }
.vp-bar { position: relative; height: 10px; border-radius: 5px; background: rgba(0, 0, 0, .08); overflow: hidden; }
.vp-bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 5px; background: linear-gradient(90deg, #0a84ff, #409cff); transition: width 1s linear; overflow: hidden; }
.vp-bar i::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .18) 0 8px, transparent 8px 16px);
  animation: stripes 1s linear infinite;
}
@keyframes stripes { to { background-position: 22.6px 0; } }
.vp-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--ink-2); margin-top: 8px; font-variant-numeric: tabular-nums; }
.vp-pct { color: var(--ink); font-weight: 600; }
.vp-count { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.vp-count div { background: rgba(0, 0, 0, .045); border-radius: 10px; padding: 9px 4px 8px; text-align: center; }
.vp-count b { display: block; font-family: var(--display); font-size: 26px; font-weight: 750; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.vp-count span { font-size: 10.5px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .07em; }
.vp-phase { margin-top: 16px; font-size: 13px; color: var(--ink-2); }
.vp-phase b { color: var(--ink); }
.vp-done { margin-top: 16px; }
.vp-done p { font-size: 15px; font-weight: 600; margin: 0 0 12px; }

/* ---------- El muro ---------- */
.wall { min-height: 100%; background: #f8f7f3; position: relative; }
.wall-bar {
  position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 18px; background: rgba(248, 247, 243, .86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: .5px solid var(--line);
}
.wall-bar b { font-size: 15px; }
.wall-n { color: var(--ink-2); margin-left: 8px; font-size: 12px; }
.wall-intro { margin: 22px 26px 0; color: var(--ink-2); font-size: 13px; }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 30px 24px; padding: 26px 26px 60px; }
.postit {
  --pc: #fff27a; position: relative; aspect-ratio: 1; padding: 20px 16px 14px; background: var(--pc);
  transform: rotate(var(--r, 0deg)); display: flex; flex-direction: column;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .06), 0 12px 20px -10px rgba(0, 0, 0, .3), inset 0 -18px 30px -24px rgba(0, 0, 0, .12);
  transition: transform .3s var(--ease-spring);
}
.postit::before {
  content: ''; position: absolute; top: -9px; left: 50%; width: 66px; height: 20px; transform: translateX(-50%) rotate(-2deg);
  background: rgba(255, 255, 255, .55); box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.board .postit:hover { transform: rotate(0deg) scale(1.04); z-index: 2; }
.postit p { font-family: 'Caveat', cursive; font-size: var(--fs, 22px); line-height: 1.12; margin: 0; flex: 1; overflow: hidden; color: #1f1f1f; overflow-wrap: anywhere; white-space: pre-line; }
.postit .by { font-size: 11.5px; font-weight: 600; color: rgba(0, 0, 0, .58); margin-top: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.postit.new { animation: stick .7s var(--ease-spring) both; }
@keyframes stick { from { opacity: 0; transform: translateY(-40px) rotate(-10deg) scale(1.25); } }
.c-yellow { --pc: #fff27a; }
.c-pink { --pc: #ffc0d1; }
.c-blue { --pc: #b9e6ff; }
.c-green { --pc: #cff5b0; }
.c-orange { --pc: #ffd59b; }
.composer {
  position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px 16px; overflow: auto;
  background: rgba(248, 247, 243, .78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: fade .2s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.composer-card { width: 300px; max-width: 100%; text-align: center; }
.composer-q { font-size: 14px; font-weight: 600; margin: 0 0 20px; line-height: 1.4; }
.postit.editing { aspect-ratio: auto; min-height: 290px; transform: rotate(-1.5deg); text-align: left; animation: stick .6s var(--ease-spring) both; }
.postit.editing textarea {
  flex: 1; width: 100%; min-height: 200px; resize: none; border: 0; outline: none; background: transparent;
  font-family: 'Caveat', cursive; font-size: 24px; line-height: 1.15; color: #1f1f1f;
}
.postit.editing textarea::placeholder { color: rgba(0, 0, 0, .35); }
.ed-by { display: grid; gap: 6px; }
.ed-by input { font: 600 12.5px var(--ui); background: rgba(255, 255, 255, .5); border: 0; border-radius: 6px; padding: 7px 9px; outline: none; color: var(--ink); }
.ed-by input:focus { background: rgba(255, 255, 255, .85); }
.composer-row { display: flex; justify-content: space-between; align-items: center; margin: 20px 0 14px; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 0; padding: 0; background: var(--pc); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.wc { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.wc.over { color: var(--danger); font-weight: 600; }
.composer-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; }

/* ---------- Biblioteca ---------- */
.lib { display: grid; grid-template-columns: 1fr 300px; height: 100%; position: relative; }
.lib-main { overflow: auto; padding: 18px 24px 32px; }
.lib-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 18px; }
.lib-h b { font-family: var(--display); font-size: 24px; letter-spacing: -.035em; font-weight: 800; }
.lib-h span { color: var(--ink-2); font-size: 12px; }
.lib-sec { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-2); margin: 4px 0 14px; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 24px 20px; margin-bottom: 30px; }
.book { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.cover {
  position: relative; aspect-ratio: 2 / 3; border-radius: 2px 5px 5px 2px; overflow: hidden; background: var(--bc, #333);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .16), 0 14px 26px -12px rgba(0, 0, 0, .45);
  transition: transform .35s var(--ease-spring);
}
.cover::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(0, 0, 0, .28) 0, rgba(255, 255, 255, .2) 2px, rgba(255, 255, 255, 0) 9px); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gen { position: absolute; inset: 0; padding: 14px 11px 12px 14px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; }
.gen b { font-family: var(--display); font-size: 15px; font-weight: 750; line-height: 1.05; letter-spacing: -.02em; }
.gen span { font-size: 10px; opacity: .8; }
.book:hover .cover { transform: translateY(-5px) rotate(-1.5deg); }
.bt { font-size: 12.5px; font-weight: 600; margin-top: 10px; line-height: 1.25; }
.ba { font-size: 11.5px; color: var(--ink-2); margin-top: 1px; }
.lib-side { border-left: .5px solid var(--line); background: rgba(245, 244, 240, .85); padding: 18px 18px 24px; overflow: auto; }
.lib-side iframe { display: block; width: 100%; height: 380px; border: 0; border-radius: 12px; background: #282828; margin-bottom: 10px; }
.lib-detail { position: absolute; inset: 0; z-index: 4; overflow: auto; background: #fbfbfa; animation: slideIn .4s var(--ease-out) both; }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } }
.back { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 14px 24px 0; font-size: 13px; font-weight: 500; }
.lib-detail-in { display: grid; grid-template-columns: 170px 1fr; gap: 30px; padding: 18px 30px 44px; max-width: 800px; }
.lib-detail h2 { font-family: var(--display); font-size: 30px; letter-spacing: -.035em; line-height: 1.05; margin: 0 0 6px; font-weight: 800; }
.lib-detail .ba { font-size: 14px; }
.lib-detail .rich p { font-size: 15px; line-height: 1.65; }

/* ---------- Sobre mí ---------- */
.about { min-height: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 26px 32px 28px; background: #fff; }
.about-face { width: 116px; height: 116px; object-fit: contain; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .18)); animation: pop .6s var(--ease-spring) both .1s; }
.about h2 { font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -.04em; margin: 12px 0 4px; }
.about-text { max-width: 460px; text-align: left; margin-top: 10px; }
.about-text p { font-size: 15px; line-height: 1.6; }
.about-links { display: flex; gap: 12px; margin: 20px 0 4px; }
.about-links a { display: block; width: 44px; height: 44px; transition: transform .25s var(--ease-spring); }
.about-links a:hover { transform: translateY(-2px) scale(1.08); }
.about-links .ic { display: block; width: 100%; height: 100%; border-radius: 28%; overflow: hidden; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.about-links .ic svg { display: block; width: 100%; height: 100%; }
.about-cta { display: grid; gap: 8px; width: 100%; max-width: 300px; margin-top: 20px; }

/* ---------- ¿Quieres hablar? (Nuevo mensaje de Mail) ---------- */
.mail { display: flex; flex-direction: column; min-height: 100%; background: #fff; }
.mail-row { display: flex; align-items: center; gap: 8px; padding: 10px 20px; border-bottom: .5px solid var(--line); font-size: 13px; color: var(--ink-2); }
.mail-row input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 14px; color: var(--ink); }
.mail-to { display: inline-block; padding: 2px 9px; border-radius: 6px; background: rgba(10, 132, 255, .12); color: #0a64d6; font-weight: 600; font-size: 13px; }
.mail-intro { margin: 16px 20px 0; font-size: 14.5px; line-height: 1.5; color: var(--ink); font-weight: 500; }
.mail-body { flex: 1; min-height: 170px; border: 0; outline: none; resize: none; padding: 10px 20px 16px; font: 15px/1.6 var(--ui); color: var(--ink); background: transparent; }
.mail-foot { padding: 12px 20px 16px; border-top: .5px solid var(--line); background: rgba(246, 246, 244, .7); }
.mail-foot .check { margin: 0 0 8px; }
.mail-send { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.mail-send .btn svg { margin-right: 2px; }
.mail-sent { min-height: 100%; display: grid; place-content: center; justify-items: center; text-align: center; padding: 30px 24px; gap: 6px; background: #fff; }
.mail-sent h2 { font-size: 22px; margin: 8px 0 0; letter-spacing: -.02em; }
.mail-sent p { color: var(--ink-2); margin: 0 0 14px; max-width: 320px; line-height: 1.5; }
.mail-plane { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: #0a84ff; color: #fff; animation: plane .8s var(--ease-spring) both; }
.mail-plane svg { width: 28px; height: 28px; }
@keyframes plane { from { transform: translate(-40px, 30px) rotate(-20deg) scale(.4); opacity: 0; } }

/* ---------- Texto (privacidad) ---------- */
.doc { max-width: 620px; padding: 26px 32px 40px; background: #fff; min-height: 100%; }
.doc h2 { font-size: 22px; letter-spacing: -.02em; margin: 0 0 16px; }
.doc p { font-size: 13.5px; line-height: 1.6; margin: 0 0 12px; }

/* ---------- Dock (liquid glass) ----------
   Cristal: fondo casi transparente, desenfoque ligero con saturación, canto con brillo y reflejo que sigue
   al ratón. En Chromium además se refracta lo que pasa por detrás (filtro SVG #lg, ver liquidGlass()). */
#dock {
  position: fixed; left: 0; right: 0; bottom: 40px; width: max-content; margin: 0 auto; z-index: 4000; isolation: isolate;
  display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 26px;
  background: rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(8px) saturate(1.8) brightness(1.1); backdrop-filter: blur(8px) saturate(1.8) brightness(1.1);
  box-shadow:
    inset 0 1px .5px rgba(255, 255, 255, .6), inset 0 -1px .5px rgba(255, 255, 255, .2),
    inset 1px 0 .5px rgba(255, 255, 255, .16), inset -1px 0 .5px rgba(255, 255, 255, .16),
    inset 0 0 20px rgba(255, 255, 255, .07), 0 14px 40px rgba(0, 0, 0, .28), 0 2px 8px rgba(0, 0, 0, .12);
  animation: dockIn .7s var(--ease-out) both .1s;
}
html.lg-refract #dock { backdrop-filter: url(#lg) blur(1.2px) saturate(1.8) brightness(1.1); }
#dock::before {
  content: ''; position: absolute; inset: 0; z-index: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, .8) 0%, rgba(255, 255, 255, .12) 28%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, .12) 72%, rgba(255, 255, 255, .6) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
#dock::after {
  content: ''; position: absolute; inset: 0; z-index: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(160px 70px at var(--mx, 25%) 0%, rgba(255, 255, 255, .32), rgba(255, 255, 255, 0) 70%);
}
@keyframes dockIn { from { transform: translateY(160%); } }
.dock-item {
  position: relative; z-index: 1; flex: none; display: block; width: 48px; height: 48px; border: 0; padding: 0; background: none; cursor: pointer;
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.dock-item:hover { transform: translateY(-2px) scale(1.12); }
.dock-item .ic { display: block; width: 100%; height: 100%; border-radius: 28%; overflow: hidden; box-shadow: 0 2px 8px rgba(0, 0, 0, .22); }
.dock-item .ic svg { display: block; width: 100%; height: 100%; }
.ic-avatar { background: #fff; display: grid !important; place-items: center; }
.ic-avatar img { width: 86%; height: 86%; object-fit: contain; transform: translateY(5%); pointer-events: none; }
.ic-img { background: #000; }
.ic-img img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.dock-item .tip {
  position: absolute; bottom: calc(100% + 14px); left: 50%; transform: translateX(-50%);
  background: #fff; color: #000; padding: 6px 12px; border-radius: 64px; font-size: 12px; font-weight: 500; letter-spacing: -.02em;
  white-space: nowrap; opacity: 0; pointer-events: none; box-shadow: 0 4px 16px rgba(0, 0, 0, .12); transition: opacity .15s ease;
}
.dock-item .tip::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -7px; border: 7px solid transparent; border-top-color: #fff; border-bottom: 0; }
.dock-item:hover .tip, .dock-item:focus-visible .tip { opacity: 1; }
.dock-item.running::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: rgba(255, 255, 255, .9); }
.dock-item.bounce { animation: bounce .7s; }
@keyframes bounce { 0%, 100% { transform: none; } 30% { transform: translateY(-18px); } 55% { transform: none; } 75% { transform: translateY(-7px); } }
.dock-sep { position: relative; z-index: 1; flex: none; width: 1px; height: 44px; border-radius: 64px; background: rgba(255, 255, 255, .25); }

/* ---------- Notificaciones ---------- */
#notifs { position: fixed; top: calc(var(--mb) + 10px); right: 12px; width: 350px; max-width: calc(100vw - 24px); display: flex; flex-direction: column; gap: 8px; z-index: 6000; pointer-events: none; }
.notif {
  pointer-events: auto; display: grid; grid-template-columns: 38px 1fr; gap: 11px; align-items: center; padding: 11px 13px; cursor: pointer;
  background: rgba(246, 246, 246, .8); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8);
  border-radius: 16px; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .14), 0 10px 30px rgba(0, 0, 0, .16);
  animation: notifIn .55s var(--ease-out) both;
}
@keyframes notifIn { from { transform: translateX(115%); } }
.notif.out { animation: notifOut .3s ease-in forwards; }
@keyframes notifOut { to { transform: translateX(115%); opacity: 0; } }
.notif img { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; background: #fff; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .1); }
.nh { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
.nt { font-weight: 650; font-size: 13px; margin-top: 1px; }
.nb { font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Móvil: pantalla de inicio ---------- */
@media (max-width: 760px) {
  .mb-item, .mb-ic { display: none; }
  .icon { width: 112px; gap: 2px; }
  .thumb-wrap { padding: 8px; }
  .thumb { width: 84px; height: 56px; border-radius: 10px; }
  .icon .label { font-size: 12.5px; padding: 2px 6px; }
  .icon.selected .thumb-wrap, .icon:hover .thumb-wrap { background: none; border-color: transparent; }
  .icon.selected .label, .icon:hover .label { background: none; text-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
  .badge { right: 0; top: 0; }
  .prog { left: 17px; right: 17px; bottom: 15px; }
  #windows { z-index: 5500; }
  .win {
    position: fixed; left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important;
    border-radius: 0; min-width: 0; transition: none; background: #fbfbfa;
  }
  .win.opening { animation: sheetIn .45s var(--ease-out) both; }
  @keyframes sheetIn { from { transform: translateY(100%); } }
  .win.closing { animation: sheetOut .28s ease-in both; }
  @keyframes sheetOut { to { transform: translateY(100%); } }
  .win-bar { height: calc(50px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0; }
  .tb-dots, .win-resize { display: none; }
  .win-back { display: block; background: none; border: 0; color: var(--accent); font-size: 16px; padding: 8px 4px; z-index: 1; cursor: pointer; }
  .win-title { font-size: 15px; left: 110px; right: 110px; }
  .notes { grid-template-columns: 1fr; }
  .notes:not(.detail-open) .notes-detail { display: none; }
  .notes.detail-open .notes-list { display: none; }
  .notes.locked .notes-detail { display: none; }
  .notes-back { display: block; background: none; border: 0; color: var(--accent); font-size: 15px; padding: 0 0 12px; cursor: pointer; }
  .notes-detail { padding: 14px 20px 60px; }
  .lib { display: block; height: auto; }
  .lib-main { overflow: visible; padding: 16px 16px 8px; }
  .shelf { grid-template-columns: repeat(3, 1fr); gap: 20px 12px; }
  .lib-side { border-left: 0; border-top: .5px solid var(--line); }
  .lib-detail { position: fixed; top: calc(50px + env(safe-area-inset-top)); }
  .lib-detail-in { grid-template-columns: 1fr; padding: 16px 20px 60px; }
  .lib-detail-in > div:first-child { width: 150px; }
  .vp { grid-template-columns: 1fr; padding: 20px; }
  .board { grid-template-columns: repeat(2, 1fr); gap: 22px 16px; padding: 22px 16px 90px; }
  .wall-intro { margin: 18px 16px 0; }
  .postit { padding: 16px 12px 10px; }
  .mm-hero h2 { font-size: 30px; }
  #dock { bottom: max(10px, env(safe-area-inset-bottom)); gap: 7px; padding: 9px; border-radius: 22px; max-width: calc(100vw - 16px); }
  .dock-item { width: 40px; height: 40px; }
  .dock-item:hover { transform: none; }
  .dock-sep { height: 36px; }
  #notifs { left: 10px; right: 10px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
