: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) { cursor: grab; touch-action: none; }
.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; }
