:root {
  --bg: #07070a;
  --card: #111116;
  --card2: #17171e;
  --ink: #f4f2ee;
  --muted: #8c8a93;
  --line: rgba(255, 255, 255, 0.09);
  --orange: #ff6a2b;
  --pink: #ff2d87;
  --violet: #7b5cff;
  --ok: #3ee08f;
  --bad: #ff4d5e;
  --grad: linear-gradient(120deg, var(--orange), var(--pink) 55%, var(--violet));
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: -20vh -20vw auto;
  height: 70vh;
  background: radial-gradient(40% 50% at 30% 40%, rgba(255, 106, 43, 0.22), transparent 70%),
    radial-gradient(40% 50% at 70% 30%, rgba(123, 92, 255, 0.22), transparent 70%);
  filter: blur(30px);
  pointer-events: none;
  z-index: -1;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 20px 16px 80px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.logo { font-weight: 800; letter-spacing: -0.02em; font-size: 18px; color: var(--ink); text-decoration: none; }
.logo b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
h1 { font-size: clamp(30px, 8vw, 46px); line-height: 1.02; letter-spacing: -0.03em; margin: 0 0 10px; font-weight: 800; }
h1 em { font: italic 400 1.08em "Instrument Serif", Georgia, serif; letter-spacing: 0; }
.sub { color: var(--muted); margin: 0 0 24px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 600;
  border-radius: 14px; padding: 14px 18px; color: #0b0b0e; background: var(--grad);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  transition: transform 0.12s, opacity 0.2s; text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.ghost { background: var(--card2); color: var(--ink); border: 1px solid var(--line); }
.btn.small { min-height: 36px; padding: 8px 12px; border-radius: 10px; font-size: 14px; }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid rgba(255, 77, 94, 0.35); }
input[type="text"], input[type="password"] {
  font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px; width: 100%; outline: none; min-height: 52px;
}
input:focus { border-color: rgba(255, 106, 43, 0.6); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.err { color: var(--bad); min-height: 1.4em; margin: 8px 0 0; font-size: 14px; }
.hidden { display: none !important; }

/* zona de subir */
.drop {
  display: grid; place-items: center; text-align: center; gap: 6px; padding: 34px 16px;
  border: 1.5px dashed rgba(255, 255, 255, 0.18); border-radius: 22px; background: var(--card);
  cursor: pointer; transition: border-color 0.2s, background 0.2s; width: 100%; color: inherit; font: inherit;
}
.drop.on { border-color: var(--orange); background: rgba(255, 106, 43, 0.07); }
.drop .big { font-weight: 700; font-size: 19px; }
.drop .muted { color: var(--muted); font-size: 14px; }
.drop .plus {
  width: 54px; height: 54px; border-radius: 18px; background: var(--grad); display: grid; place-items: center;
  margin-bottom: 6px; box-shadow: 0 10px 30px rgba(255, 45, 135, 0.25);
}
.drop .plus svg { width: 26px; height: 26px; stroke: #0b0b0e; }

/* lista de archivos */
.files { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
.file {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px;
}
.ico { text-decoration: none;
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; overflow: hidden;
  font: 700 10px ui-monospace, Consolas, monospace; color: #0b0b0e; background: var(--grad); text-transform: uppercase;
}
.ico img { width: 100%; height: 100%; object-fit: cover; }
.fname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmeta { color: var(--muted); font-size: 13px; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; margin-left: 4px; }
.tag.sz { background: rgba(123, 92, 255, 0.2); color: #b6a6ff; }
.acts { display: flex; gap: 6px; }
.iconbtn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2);
  color: var(--ink); display: grid; place-items: center; cursor: pointer; text-decoration: none; padding: 0;
}
.iconbtn svg { width: 18px; height: 18px; }
.iconbtn.del { color: var(--bad); }
.bar { height: 6px; border-radius: 99px; background: var(--card2); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; width: 0; background: var(--grad); transition: width 0.2s; }
.file.fail { border-color: rgba(255, 77, 94, 0.4); }
.empty { color: var(--muted); text-align: center; padding: 26px 0; font-size: 15px; }
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(140px);
  background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px;
  transition: transform 0.3s; z-index: 9; max-width: calc(100% - 32px);
}
.toast.on { transform: translateX(-50%) translateY(0); }

/* logo-puzzle */
.marca { display: inline-flex; font-weight: 800; letter-spacing: -0.03em; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.marca span { display: inline-block; cursor: default; padding: 0 0.01em; }
.marca span:nth-child(n+3) { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.marca span.pop { animation: pop 0.38s cubic-bezier(.3,1.6,.5,1); }
@keyframes pop { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(-0.18em) scale(1.12) rotate(-4deg); } 100% { transform: none; } }

/* código de 4 dígitos */
.pin { display: flex; gap: 10px; justify-content: center; }
.pin input {
  width: 58px; height: 68px; text-align: center; font: 700 28px ui-monospace, Consolas, monospace; padding: 0;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; outline: none;
  -webkit-text-security: disc;
}
.pin input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 106, 43, 0.18); }
.pin.mal { animation: tiembla 0.35s; }
.pin.mal input { border-color: var(--bad); }
.pin.bien input { border-color: var(--ok); }
@keyframes tiembla { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.marca span:nth-child(2) { touch-action: none; } /* sin cursor especial: no delata el secreto en PC */
.puerta {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px;
  background: rgba(7, 7, 10, 0.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.puerta.on { opacity: 1; pointer-events: auto; }
.puerta .caja { display: grid; gap: 14px; justify-items: center; }

/* ver archivos */
button.ico { border: 0; padding: 0; cursor: pointer; }
.barraSala { display: flex; justify-content: flex-end; margin-top: 14px; }
.barraSala .btn svg { width: 16px; height: 16px; }
.visor {
  position: fixed; inset: 0; z-index: 30; background: var(--bg); display: grid; grid-template-rows: auto 1fr;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.visor.on { opacity: 1; pointer-events: auto; }
.vcab { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.vnom { min-width: 0; display: grid; }
.vnom b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vnom span { color: var(--muted); font-size: 13px; }
.vacts { display: flex; gap: 8px; flex-wrap: wrap; }
.vacts .btn svg { width: 16px; height: 16px; }
.vcuerpo { min-height: 0; display: grid; place-items: center; padding: 12px; overflow: auto; }
.vcuerpo img, .vcuerpo video { max-width: 100%; max-height: 100%; border-radius: 12px; }
.vcuerpo iframe { width: 100%; height: 100%; border: 0; border-radius: 12px; background: #fff; }
.vtexto { width: 100%; height: 100%; margin: 0; overflow: auto; white-space: pre-wrap; font: 13px/1.5 ui-monospace, Consolas, monospace; color: var(--ink); background: var(--card); border-radius: 12px; padding: 14px; }
.vnada { text-align: center; display: grid; justify-items: center; gap: 14px; max-width: 360px; color: var(--ink); }
.vnada .ico { width: 64px; height: 64px; font-size: 13px; border-radius: 18px; }
.vnada .muted { color: var(--muted); font-size: 14px; }

/* comentarios */
.vmain { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; }
.vmain .vcuerpo { min-height: 0; }
.vcoms { min-height: 0; display: grid; grid-template-rows: auto 1fr auto; border-left: 1px solid var(--line); background: var(--card); }
.vcoms.hidden + *, .vmain:has(.vcoms.hidden) { grid-template-columns: 1fr; }
.ctit { padding: 12px 14px 6px; font-weight: 700; font-size: 14px; }
.clista { overflow: auto; padding: 4px 14px 10px; display: grid; gap: 10px; align-content: start; }
.cmsg { background: var(--card2); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 8px 11px; max-width: 92%; justify-self: start; }
.cmsg.mio { justify-self: end; border-radius: 14px 14px 4px 14px; background: rgba(255, 106, 43, 0.12); border-color: rgba(255, 106, 43, 0.25); }
.cde { color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; }
.ctx { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; margin-top: 2px; }
.cdel { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.cdel:hover { color: var(--bad); }
.cvacio { color: var(--muted); font-size: 14px; padding: 8px 0; }
.cform { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: end; }
.cform textarea {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; resize: none; outline: none; min-height: 44px; max-height: 120px;
}
.cform textarea:focus { border-color: rgba(255, 106, 43, 0.6); }
.iconbtn.com { position: relative; width: auto; min-width: 40px; padding: 0 8px; display: inline-flex; gap: 4px; align-items: center; justify-content: center; }
.iconbtn.com b { font-size: 12px; }
.iconbtn.com.hay { color: var(--orange); border-color: rgba(255, 106, 43, 0.35); }
@media (max-width: 760px) {
  .vmain { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(220px, 42%); }
  .vcoms { border-left: 0; border-top: 1px solid var(--line); }
}
